
1 Jan
2016
1 Jan
'16
2:17 p.m.
Can you please give an example of [] used as a type constructor? I'm still learning Haskell and don't yet know what kind is. Is it related to type constructors? Regards, - Olumide On 31/12/15 13:10, Alexander Berntsen wrote:
... On 31/12/15 14:06, Olumide wrote:
Overall, I'm a bit confused about the relationship between the type constructor f and []. f = []. In other words, [] *is* the type constructor.
In Haskell, [] is both the type constructor for lists *and* the term level value for an empty list. This is unfortunate. In ghci you can see this.
? :t [] [] :: [t] -- term level ? :k [] [] :: * -> * -- type level