Why do 3 and x (which was assigned 3) have different inferred types in Haskell? [duplicate]
There’s another factor here, mentioned in some of the links which acfoltzer includes, but it might be worth making explicit here. You’re encountering the effect of the monomorphism restriction. When you say let x = 5 you make a top-level definition of a variable. The MR insists that such definitions, when otherwise unaccompanied by a … Read more