Skip to content

Commit

Permalink
Add bang on constr, remove UNPACKs, add a comment
Browse files Browse the repository at this point in the history
UNPACK pragmas are redundant as we use a blanket -funbox-strict-fields
  • Loading branch information
harendra-kumar committed May 7, 2020
1 parent d646d35 commit 500a144
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Data/Unicode/Internal/NormalizeStream.hs
Expand Up @@ -223,12 +223,12 @@ maxDecomposeLen = 32

-- Hold an L to wait for V, hold an LV to wait for T.
data JamoBuf
= JamoLIndex {-# UNPACK #-} !Int
| JamoLV {-# UNPACK #-} !Char
= JamoLIndex !Int
| JamoLV !Char

data RegBuf
= RegOne !Char
| RegMany !Char !Char [Char]
| RegMany !Char !Char ![Char]

data ComposeState
= ComposeNone
Expand Down Expand Up @@ -368,6 +368,8 @@ composeChar mode marr = go0
go (D.decomposeChar mode ch) i st
| CC.isCombining ch -> do
pure (i, ComposeReg (insertIntoRegBuf ch rbuf))
-- The first char in RegBuf may or may not be a starter. In
-- case it is not we rely on composeStarterPair failing.
| RegOne s <- rbuf
, C.isSecondStarter ch
, Just x <- C.composeStarterPair s ch ->
Expand Down

0 comments on commit 500a144

Please sign in to comment.