[Haskell-cafe] Proposal: Non-recursive let
carter.schonwald at gmail.com
Thu Jul 11 17:40:21 CEST 2013
Yup. Nested cases *are* non recursive lets.
(Can't believe I forgot about that )
On Thursday, July 11, 2013, Edward Kmett wrote:
> 'cvml', 'oleg at okmij.org');>> wrote:
>> Jon Fairbairn wrote:
>> > It just changes forgetting to use different variable names because of
>> > recursion (which is currently uniform throughout the language) to
>> > forgetting to use non recursive let instead of let.
>> Let me bring to the record the message I just wrote on Haskell-cafe
>> and repeat the example:
>> 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 ...
>> and re-number them if I insert a new statement.
> blah = case foo 1  of
> (x, s) -> case bar x s of
> (y, s) -> case baz x y s of
> (z, s) -> ...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe