Anwendung der Maybe-Monade

case ( evaluate e l ) of
    Nothing -> Nothing
    Just a  -> case ( evaluate e r ) of
        Nothing -> Nothing
        Just b  -> Just ( a + b )
mittels der Monad-Instanz von Maybe:
evaluate e l >>= \ a ->
    evaluate e r >>= \ b ->
        return ( a + b)



2009-11-20