I must miss something but I can't see why this contrived example doesn't work:
test1 :: Int
test1 = let g = \s -> s + s
f = \u -> let h = \t -> t + t
h' = \v -> v + v
in g (h (h' u))
in f 1
ghci > parse error on input `h''
However, this equivalent piece is alright:
test2 :: Int
test2 = let g = \s -> s + s
f = \u -> let h = \t -> t + t; h' = \v -> v + v
in g (h (h' u))
in f 1
I believe it is a problem of my syntax, but I can't see anything wrong in test1. Thanks.
EDIT: Thanks for pointing the right way to find the problem. It turns out having to do with the vim-haskellConceal plugin. I copy-paste-save the code in another editor then switch back to vim and notice a different indent in the nested let-in block. Everything's fine after remove that plugin.
EDIT: I should stop blaming this plug-in as I briefly read its code without finding anything inappropriate. Maybe the "conceal" feature in vim7.3 is the root cause. But I'd rather like to go to my warm and cozy bed...