[project @ 1998-05-12 12:41:23 by simonm]
authorsimonm <unknown>
Tue, 12 May 1998 12:41:23 +0000 (12:41 +0000)
committersimonm <unknown>
Tue, 12 May 1998 12:41:23 +0000 (12:41 +0000)
- specialise some gratuitously overloaded functions

ghc/lib/std/Monad.lhs

index 2be1dba..1421209 100644 (file)
@@ -58,14 +58,17 @@ guard p         =  if p then return () else zero
 
 -- This subsumes the list-based filter function.
 
+{-# SPECIALISE filter :: (a -> Bool) -> [a] -> [a] #-}
 filter          :: MonadZero m => (a -> Bool) -> m a -> m a
 filter p        =  applyM (\x -> if p x then return x else zero)
 
 -- This subsumes the list-based concat function.
 
+{-# SPECIALISE concat :: [[a]] -> [a] #-}
 concat          :: MonadPlus m => [m a] -> m a
 concat          =  foldr (++) zero
  
+{-# SPECIALISE applyM :: (a -> [b]) -> [a] -> [b] #-}
 applyM          :: Monad m => (a -> m b) -> m a -> m b
 applyM f x      =  x >>= f
 \end{code}