Python from Wise Guy's Viewpoint

prunesquallor at comcast.net prunesquallor at comcast.net
Sat Oct 25 15:28:05 EDT 2003


gt5163b at prism.gatech.edu (Brian McNamara!) writes:

> If I have read that correctly, it looks like it admits these Haskell
> types:
>
>    lookup :: 
>       (Eq k)=> k -> Map k v -> (v -> a) -> a -> a
>    lookupDefault :: 
>       (Eq k)=> k -> Map k v -> Map k v -> (v -> a) -> a -> a
>    transformList :: 
>       (Eq k)=> k -> Map k v -> Map k v -> ([a] -> b) -> (k -> a) -> [b]
>
> Actually, rewriting all of these functions using the Error monad would
> make it all more elegant.

True.  

Monads are relative newcomers to the Lisp world.  You won't see them
very often.

The other problem is that monads don't compose.




More information about the Python-list mailing list