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

Andreas Abel andreas.abel at ifi.lmu.de
Fri Jul 12 08:12:39 CEST 2013


On 12.07.2013 02:22, Richard A. O'Keefe wrote:
> For what it's worth,
>
>> let x = 1 in
> -   let x = x+1 in
> -     let x = x+2 in
> -       x;;
>
> prints
>
> val it : int = 4
>
> in the F# interactive system, but
>
>> let x = 1 in
> - let x = x+1 in
> - let x = x+2 in
> -   x;;
>
> prints "Duplicate definition of x" at the second line.

Since silverlight does not work properly on my systems, I cannot 
tryfsharp.org.  I can try ocaml, which does not use indentation, and 
there the value is 4, and there is no ambiguity at all.

   let p = e in body

is just

   (\ p -> body) e

it cannot be simpler than that.  So I do not see your point.

-- 
Andreas Abel  <><      Du bist der geliebte Mensch.

Theoretical Computer Science, University of Munich
Oettingenstr. 67, D-80538 Munich, GERMANY

andreas.abel at ifi.lmu.de
http://www2.tcs.ifi.lmu.de/~abel/



More information about the Haskell-Cafe mailing list