[Haskell-beginners] Explanation of elem data type
Francesco Ariis
fa-ml at ariis.it
Wed Aug 4 01:03:54 UTC 2021
Il 03 agosto 2021 alle 19:36 Galaxy Being ha scritto:
> Thanks for the insights. So what then does the t a part mean? In the
> simpler version t a is [a]. Is t some container? It's not meant to be a
> function, is it?
`t` is any unary type constructor. Maybe, Tree, etc. all take one parameter
(Maybe a, Tree a, etc.); in a similar fashion [] takes one parameter
([] a). [a] is just syntactic sugar
λ> [7] :: [Int]
[7]
λ> [7] :: [] Int
[7]
More information about the Beginners
mailing list