No, in Haskell strings are represented as lists of characters. This was cute at the time it was designed, but horrible in the current world of Unicode. Also terrible for performance. Thankfully you can now use a better representation via the Text package.
Conversation
Do you still have to enable OverloadedStrings to make string literals not terrible?
1
Yup, that's correct!
1
Dang, it's been 11 years. You'd think by now it'd just be default
1
1
Yeah. I really love the approach of 'simple core' then 'let a thousand extensions bloom', but they've waited long enough to turn on some of them by default...
2
Extensions have to be in the compiler itself too, right? I can't just write a package that adds a new one?
1
Right. But they are 'firewalled' off from the core language, which is very simple.
1
I could actually be wrong though- I feel like I gave seen third-party extensions that you can add with a pragma. They might be more limited though.
1
Here's an example! github.com/ocharles/what- - just seems to be a syntax thingo though, not actually extending the typechecker. But I guess the overloaded strings thing is just a syntax thingo anyway (just wraps literals in calls to `fromString`).
1
So basically Rust extensions (but looks like run closet to when lints are)
1
Nah, I think this is more run after parsing and before type checking. Possibly before/after desugaring.
That Readme claims it has access to the type checker and can know if any expression has an instance of show
1
Oooooh, serves me right for not reading closely. And helps to read the documentation: downloads.haskell.org/~ghc/master/us ๐

