faylang / fay

A proper subset of Haskell that compiles to JavaScript
https://github.com/faylang/fay/wiki
BSD 3-Clause "New" or "Revised" License
1.29k stars 86 forks source link

Move where -> let binding transformation to the desugaring step #381

Open bergmark opened 10 years ago

bergmark commented 10 years ago

This is done in Fay.Compiler.Decl:

  PatBind srcloc (PVar _ ident) Nothing (UnGuardedRhs _ rhs) (Just bdecls) ->
    compileUnguardedRhs toplevel srcloc ident (Let S.noI bdecls rhs)

This should also not throw away the srcloc, it can be kept in the Let.

Move this to Desugar and add and throw an error on this case in the Decl module.