monomorphism-restriction
Why do 3 and x (which was assigned 3) have different inferred types in Haskell? [duplicate]
This question already has an answer here: 开发者_Go百科What is the monomorphism restriction? (1 answer)[详细]
2023-03-28 04:09 分类:问答Why are polymorphic values not inferred in Haskell?
Numeric literals have a polymorphic type: *Main> :t 3 3 :: (Num t) => t But if I bind a variable to such a literal, the polymorphism is lost:[详细]
2023-01-24 20:45 分类:问答