[Haskell-cafe] Is there a generic way to detect "mzero"?

Roman Cheplyaka roma at ro-che.info
Mon Mar 26 21:54:48 CEST 2012


* Ting Lei <tinlyx at hotmail.com> [2012-03-26 11:33:16-0700]
> I was writing a code trying to use MonadPlus to detect some error
> cases (representing missing values etc. in pure code).

You are probably looking for the MonadError class.

There's also the MonadLogic class (which allows to literally detect
mzero), but if you simply need to catch errors, it is not as
appropriate as MonadError.

-- 
Roman I. Cheplyaka :: http://ro-che.info/



More information about the Haskell-Cafe mailing list