strictly matching monadic let and overloaded Bool (was: Are patternguards obsolete?)

Claus Reinke claus.reinke at talk21.com
Thu Dec 14 06:38:29 EST 2006


> one issue arising in practice is that we would like to have
> 
>    fromBool  :: MonadPlus m => Bool -> m a
> 
> but the current definition of guard would fix the type to
> 
>    fromBool  :: MonadPlus m => Bool -> m ()
> 
> which would require type annotations for Booleans used as guards. see the
> attached example for an easy workaround.

what attachment, you ask? sorry, lack of sleep - now attached to this message.

claus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Boolean.hs
Type: application/octet-stream
Size: 794 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell-prime/attachments/20061214/0b886198/Boolean.obj


More information about the Haskell-prime mailing list