String != [Char]
Henrik Nilsson
nhn at Cs.Nott.AC.UK
Mon Mar 26 12:37:35 CEST 2012
Hi all,
Simon Marlow wrote:
> So I'm far from convinced that [Char] is a bad default for the String
> type. But it's important that as far as possible Text should not be
> a second class citizen, so I'd support adding OverloadedStrings to
> the language, and maybe looking at overloading some of the String
> APIs in the standard libraries.
I agree completely.
> One more thing: historically, performance considerations have been
> given a fairly low priority in the language design process for
> Haskell, and rightly so.
> [...]
> we should be glad that Haskell is not burdened with (many) legacy
> warts that were invented to work around performance problems that no
> longer exist. I'm not saying that this means we should ignore Text
> as a performance hack, just that performance should not come at the
> expense of good language design.
Well said.
And as Isaac Dupree reminded us:
> How is Text for small strings currently (e.g. one English word, if
> not one character)? Can we reasonably recommend it for that?
> This recent question suggests it's still not great:
> http://stackoverflow.com/questions/9398572/memory-efficient-strings-
in-haskell
even if performance was the sole goal, the "right choice" (as always)
is hardly clear cut.
Best,
/Henrik
--
Henrik Nilsson
School of Computer Science
The University of Nottingham
nhn at cs.nott.ac.uk
More information about the Haskell-prime
mailing list