[xmonad] Migrate from String to Data.Text [proposal]

Gwern Branwen gwern at gwern.net
Fri Dec 18 17:18:21 UTC 2015


On Fri, Dec 18, 2015 at 12:12 PM, Matt Walker <matt.g.d.walker at gmail.com> wrote:
> The LANGUAGE pragma of OverloadedStrings allows you to use String literals
> as Text literals, so that wouldn't be the main problem.  The main issue is
> changing all the interfaces so they accept Text instead of String, and how
> this would impact existing user configs, and the xmonad-contrib archive.
> Every time you use ++ you would have to replace it with <>, the Monoid infix
> mappend operator.  I doubt many people use : to build Strings, but in those
> instances those would have to be changed too.  Finally, pattern matching on
> Strings like (x:xs) would break as well.  All other functions would require
> changing from their String/List counterpart to the Text one.  Since the
> names clash, one would have to import qualified as, for instance, T and call
> T.intersperse or whatever.  It would be a non-trivial undertaking, but
> certainly doable.

I don't see a single benefit for the users to undergo this invasive
and painful upgrade, which is particularly harsh on the less
experienced Haskellers as it involves subtleties of types and an
unfamiliar Text type.

Neither of your two listed benefits is at all relevant to users:
Xmonad and all its extensions are not doing more than trivial amounts
of string manipulation, and Xmonad as a whole is not even a
performance bottleneck - X and the windows being displayed are the
usual slow parts.

-- 
gwern
http://www.gwern.net


More information about the xmonad mailing list