文字と文字列、リスト
'(シングルクォート)'でかこむ文字はChar型。
Prelude> :type 'a'
'a' :: Char
"(ダブルクォート)"でかこんだ文字列はChar型のリスト。[]でかこまれてるのがリストのしるし。
Prelude> :type "abc"
"abc" :: [Char]
Prelude> :type ['a','b','c']
['a','b','c'] :: [Char]
Prelude> :type "a"
"a" :: [Char]
なるほど。""でかこめば1文字でも要素ひとつのリストってわけか。 文字列を’'でかこむとエラーになる。
Prelude> :type 'abc'
<interactive>:1:1: lexical error in string/character literal
