[Haskell-cafe] maybeToM

Joachim Breitner mail at joachim-breitner.de
Mon Dec 18 11:59:45 EST 2006


Am Montag, den 18.12.2006, 17:42 +0100 schrieb Tomasz Zielonka:
> On Mon, Dec 18, 2006 at 09:29:24AM +0000, Joachim Breitner wrote:
> > 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?
> I can't see how such a generalization could look like, especially since
> "maybe" can be used with arbitrary monad:
>     maybe (fail "Nothing") return

Well, that’s a possible implementation of a maybeToM. The question is:
Is it useful enough for a name on it’s own?


Joachim "nomeata" Breitner
  mail: mail at joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C
  JID: joachimbreitner at amessage.de | http://www.joachim-breitner.de/
  Debian Developer: nomeata at debian.org

More information about the Haskell-Cafe mailing list