Changeset 15379

Show
Ignore:
Timestamp:
02/28/07 22:06:20 (21 months ago)
Author:
gaal
Message:

* quell some warnings that appear in 'make ghci'

Location:
src
Files:
10 modified

Legend:

Unmodified
Added
Removed
  • src/MO/Compile.hs

    r15378 r15379  
    44 
    55import MO.Base 
    6 import MO.Util 
     6import MO.Util () 
    77 
    88type MethodName = ID 
  • src/MO/Compile/Class.hs

    r15378 r15379  
    33module MO.Compile.Class where 
    44 
    5 import MO.Base 
     5import MO.Base () 
    66import MO.Compile 
    77import MO.Compile.Attribute 
     
    1414import qualified Pugs.Class.C3 as C3 (linearize) 
    1515 
    16 import Data.Maybe (maybeToList, fromJust) 
    1716import qualified Data.Map as Map 
    1817 
     
    7776 
    7877instance (Typeable1 m, Monad m) => Typeable (AnyClass m) where 
    79     typeOf x = typeOf (undefined :: m AnyClass_Type) 
     78    typeOf _ = typeOf (undefined :: m AnyClass_Type) 
    8079 
    8180instance (Typeable1 m, Monad m) => Eq (AnyClass m) where 
     
    126125    x == y = clsName x == clsName y 
    127126instance (Typeable1 m, Monad m) => Typeable (MI m) where 
    128     typeOf x = typeOf (undefined :: m MI_Type) 
     127    typeOf _ = typeOf (undefined :: m MI_Type) 
    129128 
    130129emptyMI :: (Typeable1 m, Monad m) => MI m 
  • src/MO/Compile/Role.hs

    r14701 r15379  
    33module MO.Compile.Role where 
    44 
    5 import MO.Base 
     5import MO.Base () 
    66import MO.Compile 
    7 import MO.Run 
     7import MO.Run () 
    88import MO.Util 
    99import MO.Compile.Attribute 
     
    1818    deriving (Eq) 
    1919 
     20emptyRole :: Role m 
    2021emptyRole = MkRole 
    2122          { roRoles                  = []  
     
    2829parent_roles = roRoles 
    2930 
     31role_public_methods, role_private_methods :: Role m -> Collection (AnyMethod m) 
    3032role_public_methods     = roPublicMethods 
    3133role_private_methods    = roPrivateMethods 
     34 
     35role_attributes :: Role m -> [Attribute m] 
    3236role_attributes         = roAttributes 
    3337 
  • src/MO/Run.hs

    r15378 r15379  
    5656 
    5757instance (Typeable1 m, Monad m) => Typeable (AnyResponder m) where 
    58     typeOf x = typeOf (undefined :: m AnyResponder_Type) 
     58    typeOf _ = typeOf (undefined :: m AnyResponder_Type) 
    5959 
    6060class Monad m => ResponderInterface m a | a -> m where 
     
    7575 
    7676mtMethod :: Monad m => MethodTable a -> MethodInvocation m -> m (MethodCompiled a) 
    77 mtMethod table inv@(MkMethodInvocation n _) = case M.lookup n (mtMethods table) of 
     77mtMethod table (MkMethodInvocation n _) = case M.lookup n (mtMethods table) of 
    7878    Just r  -> return r 
    7979    _       -> fail $ "No such method: " ++ show n 
     
    9494 
    9595instance (Typeable1 m, Monad m) => Typeable (Invocant m) where 
    96     typeOf x = typeOf (undefined :: m Invocant_Type) 
     96    typeOf _ = typeOf (undefined :: m Invocant_Type) 
    9797 
    9898ivDispatch :: (Typeable1 m, Monad m) => Invocant m -> MethodInvocation m -> m (Invocant m) 
  • src/MO/Util.hs

    r15378 r15379  
    88import Data.Map (Map) 
    99import qualified Data.Map as Map 
    10 import Control.Monad (when, fmap, Functor(..)) 
     10import Control.Monad (when) 
    1111import Debug.Trace (trace) 
    12 import Data.List (nub) 
    1312import Data.Typeable 
    1413import GHC.Exts (unsafeCoerce#, Word(W#), Word#) 
     
    5049 
    5150cmap :: (Ord a, Ord b) => (a -> b) -> Collection a -> Collection b 
    52 cmap f c@MkCollection { cByName = bn } = 
     51cmap f MkCollection { cByName = bn } = 
    5352    let l = map (\(x,y) -> (x, f y)) (Map.toList bn) 
    5453    in newCollection l 
     
    5857-- names. Must check how Set work and what MO's remove wanted. 
    5958remove :: (Monad m, Ord a) => ID -> a -> Collection a -> m (Collection a) 
    60 remove name obj c@MkCollection{ cByObject = bo, cByName = bn } = do 
     59remove name obj MkCollection{ cByObject = bo, cByName = bn } = do 
    6160    return $ MkCollection { cByObject = Set.delete obj bo 
    6261                          , cByName = Map.delete name bn 
     
    7170 
    7271insert :: (Ord a) => ID -> a -> Collection a -> Collection a 
    73 insert name obj c@MkCollection{ cByObject = bo, cByName = bn } = 
     72insert name obj MkCollection{ cByObject = bo, cByName = bn } = 
    7473    MkCollection { cByObject = Set.insert obj bo 
    7574                 , cByName = Map.insert name obj bn 
     
    106105 
    107106includes_any :: Ord a => Collection a -> [a] -> Bool 
    108 includes_any c [] = False 
     107includes_any _ [] = False 
    109108includes_any c (x:xs) = (includes c x) || (includes_any c xs) 
    110109 
    111110includes_any_name :: Ord a => Collection a -> [ID] -> Bool 
    112 includes_any_name c [] = False 
     111includes_any_name _ [] = False 
    113112includes_any_name c (x:xs) = (includes_name c x) || (includes_any_name c xs) 
    114113 
    115114includes_all :: Ord a => Collection a -> [a] -> Bool 
    116 includes_all c [] = False 
     115includes_all _ [] = False 
    117116includes_all c (x:xs) = (includes c x) && (includes_any c xs) 
    118117 
  • src/Pugs/AST/Eval.hs

    r15374 r15379  
    117117    strMsg = errStr 
    118118 
     119liftEval :: ReaderT Env SIO a -> Eval a 
    119120liftEval m = EvalT $ do 
    120121    a <- ContT (m >>=) 
  • src/Pugs/Class.hs

    r15374 r15379  
    8585    } 
    8686 
     87(./) :: (Typeable1 m, Monad m) => Invocant m -> String -> m (Invocant m) 
    8788inv ./ meth = ivDispatch inv $ MkMethodInvocation meth (mkArgs []) 
  • src/Pugs/Class/C3.hs

    r14853 r15379  
    4949    candidates = nub (map head l) 
    5050 
    51 -- | Auxiliar function for the merge operation, given a candidate list, 
     51-- | Auxiliary function for the merge operation, given a candidate list, 
    5252-- find a good candidate, return 'Nothing' if none of them can be used, 
    5353-- meaning an impossible merge due conflict. If it finds one, calls 
     
    5656merge_round _  [] = return [] 
    5757merge_round [] _  = fail "merge conflict" 
    58 merge_round (c:cs) l@(x:xs) 
     58merge_round (c:cs) l 
    5959    | good c l = do 
    6060        a <- merge clean_list 
     
    6767-- |Returns 'True' if a candidate element isn't present in the tail 
    6868-- of each list. 
    69 good c []     = True 
     69good _ []     = True 
    7070good c (x:xs) 
    7171    | c `elem` (tail x) = False 
  • src/Pugs/Internals/Cast.hs

    r15295 r15379  
    1313import GHC.Exts (unsafeCoerce#, Word(W#), Word#) 
    1414import Data.ByteString (ByteString) 
    15 import Data.Sequence (Seq, singleton) 
     15import Data.Sequence (Seq) 
    1616import Numeric (showHex) 
    1717import Data.Foldable (toList) 
  • src/UTF8.hs

    r14081 r15379  
    184184                       ,isPrefixOf,isSuffixOf,isSubstringOf 
    185185 
    186                        ,copy 
    187186                       ,getContents, putStr, putStrLn 
    188187                       ,readFile, {-mmapFile,-} writeFile 
     
    513512 
    514513inits :: ByteString -> [ByteString] 
    515 inits bs@(PS x s l) = [PS x s n | n <- rawIndices bs] 
     514inits bs@(PS x s _) = [PS x s n | n <- rawIndices bs] 
    516515 
    517516tails :: ByteString -> [ByteString] 
     
    572571-- spanEnd 
    573572spanEnd :: (Char -> Bool) -> ByteString -> (ByteString, ByteString) 
    574 spanEnd p = error "not implemented yet" 
     573spanEnd _ = error "not implemented yet" 
    575574 
    576575-- lines 
     
    653652              | otherwise = unsafeCreate (n * numBytes c) $ \p -> go n p 
    654653  where 
    655     go 0 p = return () 
     654    go 0 _ = return () 
    656655    go n p = do 
    657656      k <- putUTF8 p c  
     
    677676-- elemIndexLast 
    678677elemIndexLast :: Char -> ByteString -> Maybe Int 
    679 elemIndexLast c = undefined 
     678elemIndexLast _ = undefined 
    680679 
    681680-- findIndex 
     
    799798      is <- unsafeInterleaveIO $ go (k+i) (q `plusPtr` i) (m-i) 
    800799      return (k:is) 
    801    
     800 
     801breakFirst :: Char -> ByteString -> Maybe (ByteString, ByteString) 
    802802breakFirst c xs = let (x,y) = breakChar c xs in  
    803803  if null y then Nothing else Just (x, tail y) 
     
    808808-- use regular findSubstrings and map results back 
    809809findSubstrings :: ByteString -> ByteString -> [Int] 
    810 findSubstrings b1 b2@(PS x s l) | null b1 = [0 .. length b2] 
    811                                 | otherwise = 
    812   [ i | (i,b) <- P.zip [0..] (tails b2), b1 `isPrefixOf` b ] 
     810findSubstrings b1 b2 | null b1 = [0 .. length b2] 
     811                     | otherwise = 
     812    [ i | (i,b) <- P.zip [0..] (tails b2), b1 `isPrefixOf` b ] 
    813813 
    814814