let-where difference

Serge D. Mechveliani mechvel at botik.ru
Mon Dec 22 10:53:15 EST 2003


The program 
    f = [ 1,
          2,
          (a+b where a = 1
                     b = 2
          )
        ]
is qualified by some compilers as a wrong syntax.
And 
    f = [ 1,
          2,
          (let a = 1
               b = 2
           in  a+b
          )
        ]
is accepted.
What may be the reason for such difference, 
is this a `bug' in Haskell-98 ?

(Usually `let' and `where' are moved out of such a list construct, 
but for a large list with non-trivial expressions for the members, 
it may be natural to remain them).

Thank you in advance for the explanation.
Copy, please, the answer to               mechvel at botik.ru

-----------------
Serge Mechveliani
mechvel at botik.ru






More information about the Haskell mailing list