Somewhere in the base library you will find this definition:
type String = [Char]
which says that String
and [Char]
are exactly the same thing. Which of the two you choose is a documentation choice. I often define type aliases like this:
type Domain = ByteString
type UserName = Text
It's a good idea to use types for documentation.
Also as an important side note, [Char]
is not the type for character arrays, but character lists. Since there are also actual array types, the distinction is important!