Use String rather than [Char] where possible
Try this in GHCi
Prelude> :t "foo" "foo" :: [Char]
It would be better to say
"foo" :: String
Why don't we? Because of this in
stringTy :: Type stringTy = mkListTy charTy -- convenience only
That is, where GHC needs
String is uses
stringTy which is just
How to fix? Two ways:
Stringinto a "wired-in type". That's not hard, but it increases the number of wired-in types, which is generally undesirable.
Stringinto a "knonw-key name", and look it up in the type environment on the (few) occasions where we need
stringTy. That's a little harder -- notably
hsLitTypewould become monadic -- but not difficult.