haskell / text

Haskell library for space- and time-efficient operations over Unicode text.

Home Page:http://hackage.haskell.org/package/text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eta expand case conversions

Bodigrim opened this issue · comments

According to investigation in https://gitlab.haskell.org/ghc/ghc/-/issues/22886#note_479157, we should apply the following patch for the optimal performance in GHC 9.6:

-toLower = caseConvert (\w -> if w - 65 <= 25 then w + 32 else w) lowerMapping
+toLower = \xs -> caseConvert (\w -> if w - 65 <= 25 then w + 32 else w) lowerMapping xs

I'll give this a look and see if there are any other places where eta-expanding makes sense to convince GHC to inline.