Possibly an error in Tutorial?

13 Jan
2020
13 Jan
'20
1:21 a.m.
In this line:
For example, the principal type of `head` is `[a]->a`; `[b]->a`, `a->a`, or even `a` are correct types, but too general, whereas something like `[Integer]->Integer` is too specific.
— It is not clear how `a → a` can be a correct type for `head`, insofar as all occurrences of a type variable must be instantiated to the same concrete type. If this sentence is actually correct, perhaps it could be clarified to address the issue? This concern was raised on Reddit: https://www.reddit.com/r/haskellquestions/comments/enqhu0/how_does_head_have... Link to tutorial: https://www.haskell.org/tutorial/goodies.html
1956
Age (days ago)
1956
Last active (days ago)
0 comments
1 participants
participants (1)
-
Ignat Insarov