[Haskell-beginners] question about any

Brent Yorgey byorgey at seas.upenn.edu
Thu Dec 29 17:03:38 CET 2011


On Thu, Dec 29, 2011 at 06:45:27AM +0100, Manfred Lotz wrote:
> 
> or' :: Monad m => ( a -> m Bool) -> [a] -> [m Bool]
> or' _ [] = []
> or' p (x:xs) = p x : or' p xs
> 
> and' :: Monad m => ( a -> m Bool) -> [a] -> [m Bool]
> and' _ [] = []
> and' p (x:xs) = p x : and' p xs

Note that or' = and' = map.

-Brent



More information about the Beginners mailing list