r/purescript • u/Lokathor • Feb 12 '16
Why have explicit universal quantification?
It seems to me, coming from Haskell, that requiring every type signature to include the explicit universal quantification just leads to a lot of line noise. Particularly when there's also a typeclass constraint.
Are there plans to make a compiler option that would remove the need to explicitly give the universal qualification? Why was it even chosen in the first place?
5
Upvotes
View all comments
Show parent comment
1
u/Lokathor Feb 13 '16
What do you mean by this? Why can't it just be the case that length :: Array a -> Number And then, simply because the 'a' is lowercase, we automatically know as readers that it will clearly be a polymorphic type variable?
Even in the case of record syntax for type signatures, record elements stick a type signature after each entry, so the general rule of "lowercase tokens without a type signature on them are implicitly for all" would hold.