Die Konstruktorklasse Monad

class Functor c => Monad c where
    return  :: a -> c a
    ( >>= ) :: c a -> (a -> c b) -> c b

instance Monad Maybe where
    return = \ x -> Just x
    m >>= f = case m of
        Nothing -> Nothing
        Just x  -> f x



2009-11-20