Skip to content

Commit

Permalink
Refactor decomposition and composition.
Browse files Browse the repository at this point in the history
  • Loading branch information
wismill committed Jun 19, 2022
1 parent 916ea7c commit 6c484c8
Show file tree
Hide file tree
Showing 5 changed files with 284 additions and 229 deletions.
12 changes: 5 additions & 7 deletions Data/Text/Normalize.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module Data.Text.Normalize
NormalizationMode(..)
-- * Normalization API
, normalize
, normalizeQC
) where

import Data.Text (Text)
Expand All @@ -25,9 +24,8 @@ import Data.Unicode.Types (NormalizationMode(..))
-- Internal modules
import Data.Unicode.Internal.NormalizeStream
( DecomposeMode(..)
, normalizeQC
, stream
, unstream
, unstreamD
, unstreamC
)

Expand All @@ -36,7 +34,7 @@ import Data.Unicode.Internal.NormalizeStream
normalize :: NormalizationMode -> Text -> Text
normalize mode =
case mode of
NFD -> (unstream Canonical) . stream
NFKD -> (unstream Kompat) . stream
NFC -> (unstreamC Canonical) . stream
NFKC -> (unstreamC Kompat) . stream
NFD -> unstreamD Canonical . stream
NFKD -> unstreamD Kompat . stream
NFC -> unstreamC Canonical . stream
NFKC -> unstreamC Kompat . stream
Loading

0 comments on commit 6c484c8

Please sign in to comment.