Haskell: Where vs. Let
1: The problem in the example f :: State s a f = State $ \x -> y where y = … x … is the parameter x. Things in the where clause can refer only to the parameters of the function f (there are none) and things in outer scopes. 2: To use a … Read more