
Hi, dons mentions in his blog post that Data.Map’s lookup is generalized over the Monads, whereas Prelude.maybe isn’t. Are there good reasons not to do that to Prelude.maybe as well? Alternatively, how about adding this function to Data.Maybe, analogous to maybeToList
maybeToM Nothing = fail "Nothing" maybeToM (Just x) = return x
(Incidentially, this function is the same as maybeToList if run in the List Monad). This way, Prelude.lookup (or any function that returns a Maybe) can be generalized as (maybeToM . lookup). Greetings, Joachim -- Joachim "nomeata" Breitner mail: mail@joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C JID: joachimbreitner@amessage.de | http://www.joachim-breitner.de/ Debian Developer: nomeata@debian.org