[Haskell-cafe] Non-recursive let [Was: GHC bug? Let with guards loops]

Ertugrul Söylemez es at ertes.de
Wed Jul 10 10:16:38 CEST 2013


oleg at okmij.org wrote:

> Hear, hear! In OCaml, I can (and often do) write
>
>         let (x,s) = foo 1 [] in
>         let (y,s) = bar x s in
>         let (z,s) = baz x y s in ...
>
> In Haskell I'll have to uniquely number the s's:
>
>         let (x,s1)  = foo 1 [] in
>         let (y,s2)  = bar x s1 in
>         let (z,s3)  = baz x y s2 in ...

This isn't a case for non-recursive let.  It is one of the rare cases
where you might actually consider using a state monad.


Greets,
Ertugrul

-- 
Not to be or to be and (not to be or to be and (not to be or to be and
(not to be or to be and ... that is the list monad.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130710/38d1c17b/attachment.pgp>


More information about the Haskell-Cafe mailing list