Some notes regarding types and typeclasses in Haskell.
It's crucial to distinguish between the type constructor and the value constructor.
When declaring a data type, the part before the = is the type constructor, and the constructors after it (possibly separated by |'s) are value constructors
It's when all the value constructors take no parameters.
e.g.:
ghci> data Day = Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | SundayIt is the parameter that we define in the type constructor.
For example, a is s type parameter.
data Maybe a = Nothing | Just a When I apply an extra type to Maybe, like Maybe String, then I have a concrete type.
Values can only have types that are concrete types!
Here's how the standard library uses type synonym to define String as a synonym for [Char].
type String = [Char]