[Haskell] return?

Chung-chieh Shan ccshan at post.harvard.edu
Thu Apr 29 21:48:39 EDT 2004


On 2004-04-29T18:27:32-0500, Ben_Yu at asc.aon.com wrote:
> While writing monad programs, I sometimes want to do a return as it is in
> imperative program. i.e.,
> do{return 1; return 2} is same as return 1

Hello,

You can build an error monad transformer along the lines of the
Control.Monad.Error module, in particular the ErrorT data type there
(but without the Error class).  You can then replace "return" above with
"throwError" for your error monad transformer.

	Ken

-- 
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
BBC News: Universities face week of protest
http://news.bbc.co.uk/1/hi/education/3508209.stm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://www.haskell.org//pipermail/haskell/attachments/20040429/6466a2d9/attachment.bin


More information about the Haskell mailing list