The meaning of tilde in Haskell types (Type equality)

前端 未结 1 1151
小蘑菇
小蘑菇 2020-12-18 22:44

I\'ve been messing around with the fix function, and I happened across this:

λ let fix f = let x = f x in x
λ fix (+)

:15:5:         


        
相关标签:
1条回答
  • 2020-12-18 23:03

    Tilde (~) in that error means type equality. It is telling you that it cannot deduce t to be t -> t. The symbol is also used for irrefutable patterns, but that's a completely different context.

    0 讨论(0)
提交回复
热议问题