[Haskell-cafe] Irritating Referential Transparency behavior?

martin martin.drautzburg at web.de
Sun Aug 10 20:26:15 UTC 2014


Am 08/10/2014 08:52 PM, schrieb Albert Y. C. Lai:
> On 14-08-10 02:20 PM, martin wrote:
>> exProcess2 pState loc = LP {lstep = xxx}
>>          where
>>              xxx = myStep pState
> 
> vs
> 
>> exProcess2 pState loc = LP {lstep = myStep pState}
>>          where
>>              xxx = myStep pState
> 
> The monomorphism restriction requires assigning a monomorphic (non-polymorphic) type to xxx. The assignment could come
> from declaring xxx's type (which you didn't do) or inferring from use sites (which you had in one example but not in
> another). When both are lacking, a job that needs done can't be done, and it is an error.

Very clear explanation. Thanks



More information about the Haskell-Cafe mailing list