diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,8 +1,15 @@
 # Revision history for Z-Data
 
+## 0.1.6.1  -- 2020-10-09
+
+* Remove `Str` newtype.
+* Make `CBytes` a newtype.
+* Add JSON instances for `ExitCode`, Add Unaligned instances for `Ptr a`.
+* Use type alias instead of newtypes for `Locale`, `Category` in `Z.Data.Text`. 
+
 ## 0.1.6.0  -- 2020-10-09
 
-* Rename `ToText` to `ShowT`, `toText` to `showT`, add FFI types instances.
+* Rename `ToText` to `ShowT`, `toText` to `showT`, add FFI types instances, remove `Str` newtype.
 * Change `Text` 's `Show` and `ShowT` escaping rules to reuse JSON escaping, remove `Read` instance.
 * Add `ShowT` instances to `CBytes` and FFI types.
 
diff --git a/Z-Data.cabal b/Z-Data.cabal
--- a/Z-Data.cabal
+++ b/Z-Data.cabal
@@ -1,6 +1,6 @@
 cabal-version:              2.4
 name:                       Z-Data
-version:                    0.1.6.0
+version:                    0.1.6.1
 synopsis:                   Array, vector and text
 description:                This package provides array, slice and text operations
 license:                    BSD-3-Clause
@@ -177,12 +177,14 @@
                             DeriveAnyClass
                             DefaultSignatures
                             DataKinds
+                            ExistentialQuantification
                             FlexibleContexts
                             FlexibleInstances
                             GeneralizedNewtypeDeriving 
                             KindSignatures
                             MagicHash
                             MultiParamTypeClasses
+                            MultiWayIf
                             PartialTypeSignatures
                             PatternSynonyms 
                             PolyKinds
diff --git a/Z/Data/Array/Unaligned.hs b/Z/Data/Array/Unaligned.hs
--- a/Z/Data/Array/Unaligned.hs
+++ b/Z/Data/Array/Unaligned.hs
@@ -23,6 +23,8 @@
 import           GHC.Float (stgFloatToWord32, stgWord32ToFloat, stgWord64ToDouble, stgDoubleToWord64)
 import           Foreign.C.Types
 
+#include "MachDeps.h"
+
 -- toggle these defs to test different implements
 #define USE_BSWAP
 -- #define USE_SHIFT
@@ -729,6 +731,17 @@
 #endif
 
 --------------------------------------------------------------------------------
+
+instance Unaligned (Ptr a) where
+    {-# INLINE unalignedSize #-}
+    unalignedSize _ = SIZEOF_HSPTR
+    {-# INLINE writeWord8ArrayAs# #-}
+    writeWord8ArrayAs# mba# i# (Ptr x#) = writeWord8ArrayAsAddr# mba# i# x#
+    {-# INLINE readWord8ArrayAs# #-}
+    readWord8ArrayAs# mba# i# s0 =
+        let !(# s1, x# #) = readWord8ArrayAsAddr# mba# i# s0 in (# s1, Ptr x# #)
+    {-# INLINE indexWord8ArrayAs# #-}
+    indexWord8ArrayAs# ba# i# = Ptr (indexWord8ArrayAsAddr# ba# i#)
 
 instance Unaligned Float where
     {-# INLINE unalignedSize #-}
diff --git a/Z/Data/CBytes.hs b/Z/Data/CBytes.hs
--- a/Z/Data/CBytes.hs
+++ b/Z/Data/CBytes.hs
@@ -85,12 +85,12 @@
 -- return a filename which is not proper encoded in any unicode encoding at all.
 -- But still, UTF-8 is recommanded to be used when text represatation is needed.
 -- --
-data CBytes = CBytes
+newtype CBytes = CBytes
     {
         -- | Convert to 'PrimArray',
         --
         -- there's an invariance that this array never contains @\NUL@
-        toPrimArray :: {-# UNPACK #-} !(PrimArray Word8)
+        toPrimArray :: PrimArray Word8
     }
 
 -- | Use this pattern to match or construct 'CBytes', result will be trimmed down to first byte before @\NUL@ byte if there's any.
diff --git a/Z/Data/JSON/Base.hs b/Z/Data/JSON/Base.hs
--- a/Z/Data/JSON/Base.hs
+++ b/Z/Data/JSON/Base.hs
@@ -72,6 +72,8 @@
 import           GHC.Exts                     (Proxy#, proxy#)
 import           GHC.Generics
 import           GHC.Natural
+import           System.Exit
+import           Text.ParserCombinators.ReadP (readP_to_S)
 import qualified Z.Data.Builder             as B
 import           Z.Data.Generics.Utils
 import           Z.Data.JSON.Value          (Value(..))
@@ -87,7 +89,6 @@
 import qualified Z.Data.Vector.FlatIntSet   as FIS
 import qualified Z.Data.Vector.FlatMap      as FM
 import qualified Z.Data.Vector.FlatSet      as FS
-import           Text.ParserCombinators.ReadP (readP_to_S)
 
 --------------------------------------------------------------------------------
 
@@ -347,7 +348,7 @@
         _      -> fail' . T.buildText $ do
             "converting "
             T.text name
-            "failed, value is either floating or will cause over or underflow "
+            "failed, value is either floating or will cause over or underflow: "
             T.scientific x
 withBoundedIntegral name _ v = typeMismatch name "Number" v
 
@@ -885,16 +886,6 @@
 instance ToValue T.Text     where {{-# INLINE toValue #-}; toValue = String;}
 instance EncodeJSON T.Text where {{-# INLINE encodeJSON #-}; encodeJSON = JB.string;}
 
-instance FromValue T.Str where
-    {-# INLINE fromValue #-}
-    fromValue = withText "Str" (pure . T.Str . T.unpack)
-instance ToValue T.Str where
-    {-# INLINE toValue #-}
-    toValue = String . T.pack . T.chrs
-instance EncodeJSON T.Str where
-    {-# INLINE encodeJSON #-}
-    encodeJSON = JB.string . T.pack . T.chrs
-
 instance FromValue Scientific where {{-# INLINE fromValue #-}; fromValue = withScientific "Scientific" pure;}
 instance ToValue Scientific where {{-# INLINE toValue #-}; toValue = Number;}
 instance EncodeJSON Scientific where {{-# INLINE encodeJSON #-}; encodeJSON = B.scientific;}
@@ -1169,6 +1160,25 @@
 instance EncodeJSON () where
     {-# INLINE encodeJSON #-}
     encodeJSON () = "[]"
+
+instance FromValue ExitCode where
+    {-# INLINE fromValue #-}
+    fromValue (String "ExitSuccess") = return ExitSuccess
+    fromValue (Number x) =
+        case toBoundedInteger x of
+            Just i -> return (ExitFailure i)
+            _      -> fail' . T.buildText $ do
+                "converting ExitCode failed, value is either floating or will cause over or underflow: "
+                T.scientific x
+    fromValue _ =  fail' "converting ExitCode failed, expected a string or number"
+instance ToValue ExitCode where
+    {-# INLINE toValue #-}
+    toValue ExitSuccess = String "ExitSuccess"
+    toValue (ExitFailure n) = Number (fromIntegral n)
+instance EncodeJSON ExitCode where
+    {-# INLINE encodeJSON #-}
+    encodeJSON ExitSuccess = "ExitSuccess"
+    encodeJSON (ExitFailure n) = B.int n
 
 instance FromValue Version where
     {-# INLINE fromValue #-}
diff --git a/Z/Data/Parser/Numeric.hs b/Z/Data/Parser/Numeric.hs
--- a/Z/Data/Parser/Numeric.hs
+++ b/Z/Data/Parser/Numeric.hs
@@ -42,7 +42,6 @@
 import           Data.Int
 import qualified Data.Scientific          as Sci
 import           Data.Word
-import           Foreign.Ptr              (IntPtr)
 import qualified Z.Data.Builder.Numeric as B
 import           Z.Data.Parser.Base     (Parser, (<?>))
 import qualified Z.Data.Parser.Base     as P
@@ -67,18 +66,6 @@
 --
 hex :: (Integral a, Bits a) => Parser a
 {-# INLINE hex #-}
-{-# SPECIALIZE INLINE hex :: Parser Int    #-}
-{-# SPECIALIZE INLINE hex :: Parser Int64  #-}
-{-# SPECIALIZE INLINE hex :: Parser Int32  #-}
-{-# SPECIALIZE INLINE hex :: Parser Int16  #-}
-{-# SPECIALIZE INLINE hex :: Parser Int8   #-}
-{-# SPECIALIZE INLINE hex :: Parser Word   #-}
-{-# SPECIALIZE INLINE hex :: Parser Word64 #-}
-{-# SPECIALIZE INLINE hex :: Parser Word32 #-}
-{-# SPECIALIZE INLINE hex :: Parser Word16 #-}
-{-# SPECIALIZE INLINE hex :: Parser Word8  #-}
-{-# SPECIALIZE INLINE hex :: Parser Integer #-}
-{-# SPECIALIZE INLINE hex :: Parser IntPtr #-}
 hex = "Z.Data.Parser.Numeric.hex" <?> hexLoop 0 <$> P.takeWhile1 isHexDigit
 
 -- | decode hex digits sequence within an array.
@@ -103,17 +90,6 @@
 -- | Parse and decode an unsigned decimal number.
 uint :: (Integral a) => Parser a
 {-# INLINE uint #-}
-{-# SPECIALIZE INLINE uint :: Parser Int    #-}
-{-# SPECIALIZE INLINE uint :: Parser Int64  #-}
-{-# SPECIALIZE INLINE uint :: Parser Int32  #-}
-{-# SPECIALIZE INLINE uint :: Parser Int16  #-}
-{-# SPECIALIZE INLINE uint :: Parser Int8   #-}
-{-# SPECIALIZE INLINE uint :: Parser Word   #-}
-{-# SPECIALIZE INLINE uint :: Parser Word64 #-}
-{-# SPECIALIZE INLINE uint :: Parser Word32 #-}
-{-# SPECIALIZE INLINE uint :: Parser Word16 #-}
-{-# SPECIALIZE INLINE uint :: Parser Word8  #-}
-{-# SPECIALIZE INLINE uint :: Parser Integer #-}
 uint = "Z.Data.Parser.Numeric.uint" <?> decLoop 0 <$> P.takeWhile1 isDigit
 
 -- | decode digits sequence within an array.
@@ -143,17 +119,6 @@
 -- character.
 int :: (Integral a) => Parser a
 {-# INLINE int #-}
-{-# SPECIALIZE INLINE int :: Parser Int    #-}
-{-# SPECIALIZE INLINE int :: Parser Int64  #-}
-{-# SPECIALIZE INLINE int :: Parser Int32  #-}
-{-# SPECIALIZE INLINE int :: Parser Int16  #-}
-{-# SPECIALIZE INLINE int :: Parser Int8   #-}
-{-# SPECIALIZE INLINE int :: Parser Word   #-}
-{-# SPECIALIZE INLINE int :: Parser Word64 #-}
-{-# SPECIALIZE INLINE int :: Parser Word32 #-}
-{-# SPECIALIZE INLINE int :: Parser Word16 #-}
-{-# SPECIALIZE INLINE int :: Parser Word8  #-}
-{-# SPECIALIZE INLINE int :: Parser Integer #-}
 int = "Z.Data.Parser.Numeric.int" <?> do
     w <- P.peek
     if w == MINUS
diff --git a/Z/Data/Text.hs b/Z/Data/Text.hs
--- a/Z/Data/Text.hs
+++ b/Z/Data/Text.hs
@@ -78,12 +78,68 @@
   , isNormalized, isNormalizedTo, normalize, normalizeTo
     -- ** Case conversion
     -- $case
-  , Locale(..)
   , envLocale
   , caseFold, caseFoldWith, toLower, toLowerWith, toUpper, toUpperWith, toTitle, toTitleWith
     -- ** Unicode category
   , isCategory, spanCategory
-  , Category(..)
+  -- * Constants
+  -- ** Locale
+  , Locale
+  , pattern LocaleDefault
+  , pattern LocaleLithuanian
+  , pattern LocaleTurkishAndAzeriLatin
+  -- ** Category
+  , Category
+  , pattern CategoryLetterUppercase
+  , pattern CategoryLetterLowercase
+  , pattern CategoryLetterTitlecase
+  , pattern CategoryLetterOther
+  , pattern CategoryLetter
+  , pattern CategoryCaseMapped
+  , pattern CategoryMarkNonSpacing
+  , pattern CategoryMarkSpacing
+  , pattern CategoryMarkEnclosing
+  , pattern CategoryMark
+  , pattern CategoryNumberDecimal
+  , pattern CategoryNumberLetter
+  , pattern CategoryNumberOther
+  , pattern CategoryNumber
+  , pattern CategoryPunctuationConnector
+  , pattern CategoryPunctuationDash
+  , pattern CategoryPunctuationOpen
+  , pattern CategoryPunctuationClose
+  , pattern CategoryPunctuationInitial
+  , pattern CategoryPunctuationFinal
+  , pattern CategoryPunctuationOther
+  , pattern CategoryPunctuation
+  , pattern CategorySymbolMath
+  , pattern CategorySymbolCurrency
+  , pattern CategorySymbolModifier
+  , pattern CategorySymbolOther
+  , pattern CategorySymbol
+  , pattern CategorySeparatorSpace
+  , pattern CategorySeparatorLine
+  , pattern CategorySeparatorParagraph
+  , pattern CategorySeparator
+  , pattern CategoryControl
+  , pattern CategoryFormat
+  , pattern CategorySurrogate
+  , pattern CategoryPrivateUse
+  , pattern CategoryUnassigned
+  , pattern CategoryCompatibility
+  , pattern CategoryIgnoreGraphemeCluster
+  , pattern CategoryIscntrl
+  , pattern CategoryIsprint
+  , pattern CategoryIsspace
+  , pattern CategoryIsblank
+  , pattern CategoryIsgraph
+  , pattern CategoryIspunct
+  , pattern CategoryIsalnum
+  , pattern CategoryIsalpha
+  , pattern CategoryIsupper
+  , pattern CategoryIslower
+  , pattern CategoryIsdigit
+  , pattern CategoryIsxdigit
  ) where
 
 import           Z.Data.Text.Base
diff --git a/Z/Data/Text/Base.hs b/Z/Data/Text/Base.hs
--- a/Z/Data/Text/Base.hs
+++ b/Z/Data/Text/Base.hs
@@ -42,68 +42,68 @@
   , isNormalized, isNormalizedTo, normalize, normalizeTo
     -- ** Case conversion
     -- $case
-  , Locale(LocaleDefault, LocaleLithuanian, LocaleTurkishAndAzeriLatin)
   , envLocale
   , caseFold, caseFoldWith, toLower, toLowerWith, toUpper, toUpperWith, toTitle, toTitleWith
     -- ** Unicode category
   , isCategory, spanCategory
-  , Category(
-        CategoryLetterUppercase
-      , CategoryLetterLowercase
-      , CategoryLetterTitlecase
-      , CategoryLetterOther
-      , CategoryLetter
-      , CategoryCaseMapped
-
-      , CategoryMarkNonSpacing
-      , CategoryMarkSpacing
-      , CategoryMarkEnclosing
-      , CategoryMark
-
-      , CategoryNumberDecimal
-      , CategoryNumberLetter
-      , CategoryNumberOther
-      , CategoryNumber
-
-      , CategoryPunctuationConnector
-      , CategoryPunctuationDash
-      , CategoryPunctuationOpen
-      , CategoryPunctuationClose
-      , CategoryPunctuationInitial
-      , CategoryPunctuationFinal
-      , CategoryPunctuationOther
-      , CategoryPunctuation
-
-      , CategorySymbolMath
-      , CategorySymbolCurrency
-      , CategorySymbolModifier
-      , CategorySymbolOther
-      , CategorySymbol
-
-      , CategorySeparatorSpace
-      , CategorySeparatorLine
-      , CategorySeparatorParagraph
-      , CategorySeparator
-      , CategoryControl
-      , CategoryFormat
-      , CategorySurrogate
-      , CategoryPrivateUse
-      , CategoryUnassigned
-      , CategoryCompatibility
-      , CategoryIgnoreGraphemeCluster
-      , CategoryIscntrl
-
-      , CategoryIsprint
-      , CategoryIsspace
-      , CategoryIsblank
-      , CategoryIsgraph
-      , CategoryIspunct
-      , CategoryIsalnum
-      , CategoryIsalpha
-      , CategoryIsupper
-      , CategoryIslower
-      , CategoryIsdigit
-      , CategoryIsxdigit)
+  -- * Constants
+  -- ** Locale
+  , Locale
+  , pattern LocaleDefault
+  , pattern LocaleLithuanian
+  , pattern LocaleTurkishAndAzeriLatin
+  -- ** Category
+  , Category
+  , pattern CategoryLetterUppercase
+  , pattern CategoryLetterLowercase
+  , pattern CategoryLetterTitlecase
+  , pattern CategoryLetterOther
+  , pattern CategoryLetter
+  , pattern CategoryCaseMapped
+  , pattern CategoryMarkNonSpacing
+  , pattern CategoryMarkSpacing
+  , pattern CategoryMarkEnclosing
+  , pattern CategoryMark
+  , pattern CategoryNumberDecimal
+  , pattern CategoryNumberLetter
+  , pattern CategoryNumberOther
+  , pattern CategoryNumber
+  , pattern CategoryPunctuationConnector
+  , pattern CategoryPunctuationDash
+  , pattern CategoryPunctuationOpen
+  , pattern CategoryPunctuationClose
+  , pattern CategoryPunctuationInitial
+  , pattern CategoryPunctuationFinal
+  , pattern CategoryPunctuationOther
+  , pattern CategoryPunctuation
+  , pattern CategorySymbolMath
+  , pattern CategorySymbolCurrency
+  , pattern CategorySymbolModifier
+  , pattern CategorySymbolOther
+  , pattern CategorySymbol
+  , pattern CategorySeparatorSpace
+  , pattern CategorySeparatorLine
+  , pattern CategorySeparatorParagraph
+  , pattern CategorySeparator
+  , pattern CategoryControl
+  , pattern CategoryFormat
+  , pattern CategorySurrogate
+  , pattern CategoryPrivateUse
+  , pattern CategoryUnassigned
+  , pattern CategoryCompatibility
+  , pattern CategoryIgnoreGraphemeCluster
+  , pattern CategoryIscntrl
+  , pattern CategoryIsprint
+  , pattern CategoryIsspace
+  , pattern CategoryIsblank
+  , pattern CategoryIsgraph
+  , pattern CategoryIspunct
+  , pattern CategoryIsalnum
+  , pattern CategoryIsalpha
+  , pattern CategoryIsupper
+  , pattern CategoryIslower
+  , pattern CategoryIsdigit
+  , pattern CategoryIsxdigit
   -- * Misc
   , TextException(..), errorEmptyText
   , c_utf8_validate_ba
diff --git a/Z/Data/Text/ShowT.hs b/Z/Data/Text/ShowT.hs
--- a/Z/Data/Text/ShowT.hs
+++ b/Z/Data/Text/ShowT.hs
@@ -18,8 +18,6 @@
 module Z.Data.Text.ShowT
   ( -- * ShowT class
   ShowT(..), showT, toBuilder, toBytes, toString
-  -- * Str newtype
-  , Str(..)
   -- * Textual Builder
   , TextBuilder
   , getBuilder
@@ -76,6 +74,8 @@
 import           GHC.Generics
 import           GHC.Stack
 import           Data.Version
+import           System.Exit
+import           Test.QuickCheck.Arbitrary (Arbitrary(..), CoArbitrary(..))
 import           Data.Primitive.Types
 import qualified Z.Data.Builder.Base            as B
 import qualified Z.Data.Builder.Numeric         as B
@@ -83,8 +83,6 @@
 import           Z.Data.Text.Base               (Text(..))
 import qualified Z.Data.Array                   as A
 import qualified Z.Data.Vector.Base             as V
-import           Text.Read                      (Read(..))
-import           Test.QuickCheck.Arbitrary (Arbitrary(..), CoArbitrary(..))
 
 #define DOUBLE_QUOTE 34
 
@@ -321,29 +319,6 @@
 intercalateList (TextBuilder s) f = TextBuilder . B.intercalateList s (getBuilder . f)
 
 --------------------------------------------------------------------------------
--- | Newtype wrapper for @[Char]@ to provide textual instances.
---
--- We didn't provide special treatment to differentiate instances between @[a]@ and @[Char]@
--- in various classes, e.g. 'Z.Data.JSON.ToJSON'.
---
--- This newtype is therefore to provide instances similar to @T.Text@, in case you really
--- need to wrap a 'String'.
---
--- >>> Z.Data.JSON.encodeText ("abc" :: String)
--- > "[\"a\",\"b\",\"c\"]"   -- Just like any other [a]'s instance
--- >>> Z.Data.JSON.encodeText . Str $ ("abc" :: String)
--- > "\"abc\""
---
-newtype Str = Str { chrs :: [Char] } deriving stock (Eq, Ord, Generic)
-
-instance Show Str where show = show . chrs
-instance Read Str where readPrec = Str <$> readPrec
-
-instance ShowT Str where
-    {-# INLINE toTextBuilder #-}
-    toTextBuilder _ = TextBuilder . B.string8 . show
-
---------------------------------------------------------------------------------
 -- Data types
 --
 -- | A class similar to 'Show', serving the purpose that quickly convert a data type to a 'Text' value.
@@ -351,10 +326,10 @@
 -- You can use newtype or generic deriving to implement instance of this class quickly:
 --
 -- @
---  {-## LANGUAGE GeneralizedNewtypeDeriving ##-}
---  {-## LANGUAGE DeriveAnyClass ##-}
---  {-## LANGUAGE DeriveGeneric ##-}
---  {-## LANGUAGE DerivingStrategies ##-}
+--  {-\# LANGUAGE GeneralizedNewtypeDeriving \#-}
+--  {-\# LANGUAGE DeriveAnyClass \#-}
+--  {-\# LANGUAGE DeriveGeneric \#-}
+--  {-\# LANGUAGE DerivingStrategies \#-}
 --
 --  import GHC.Generics
 --
@@ -676,6 +651,7 @@
 deriving newtype instance ShowT CFloat
 deriving newtype instance ShowT CDouble
 
+deriving anyclass instance ShowT ExitCode
 deriving anyclass instance ShowT a => ShowT (Semigroup.Min a)
 deriving anyclass instance ShowT a => ShowT (Semigroup.Max a)
 deriving anyclass instance ShowT a => ShowT (Semigroup.First a)
diff --git a/Z/Data/Text/UTF8Rewind.hsc b/Z/Data/Text/UTF8Rewind.hsc
--- a/Z/Data/Text/UTF8Rewind.hsc
+++ b/Z/Data/Text/UTF8Rewind.hsc
@@ -20,14 +20,14 @@
 #include "utf8rewind.h"
 
 -- | Locale for case mapping.
-newtype Locale = Locale CSize deriving (Show, Eq, Ord, Generic)
+type Locale = CSize 
 
 pattern LocaleDefault              :: Locale 
-pattern LocaleDefault               = Locale (#const UTF8_LOCALE_DEFAULT)
+pattern LocaleDefault               = #const UTF8_LOCALE_DEFAULT
 pattern LocaleLithuanian           :: Locale
-pattern LocaleLithuanian            = Locale (#const UTF8_LOCALE_LITHUANIAN)
+pattern LocaleLithuanian            = #const UTF8_LOCALE_LITHUANIAN
 pattern LocaleTurkishAndAzeriLatin :: Locale
-pattern LocaleTurkishAndAzeriLatin  = Locale (#const UTF8_LOCALE_TURKISH_AND_AZERI_LATIN)
+pattern LocaleTurkishAndAzeriLatin  = #const UTF8_LOCALE_TURKISH_AND_AZERI_LATIN
 
 -- | Get environment locale
 foreign import ccall unsafe "utf8envlocale" envLocale :: IO Locale
@@ -63,8 +63,7 @@
 -- | Unicode categories.
 --
 -- See 'Z.Data.Text.Base.isCategory', you can combine categories with bitwise or.
-newtype Category = Category CSize deriving (Show, Eq, Ord, Generic)
-                                    deriving newtype (Bits, FiniteBits)
+type Category = CSize 
 
 pattern CategoryLetterUppercase       :: Category
 pattern CategoryLetterLowercase       :: Category
@@ -72,30 +71,30 @@
 pattern CategoryLetterOther           :: Category
 pattern CategoryLetter                :: Category
 pattern CategoryCaseMapped            :: Category
-pattern CategoryLetterUppercase        = Category (#const UTF8_CATEGORY_LETTER_UPPERCASE)
-pattern CategoryLetterLowercase        = Category (#const UTF8_CATEGORY_LETTER_LOWERCASE)
-pattern CategoryLetterTitlecase        = Category (#const UTF8_CATEGORY_LETTER_TITLECASE)
-pattern CategoryLetterOther            = Category (#const UTF8_CATEGORY_LETTER_OTHER)
-pattern CategoryLetter                 = Category (#const UTF8_CATEGORY_LETTER)
-pattern CategoryCaseMapped             = Category (#const UTF8_CATEGORY_CASE_MAPPED)
+pattern CategoryLetterUppercase        = #const UTF8_CATEGORY_LETTER_UPPERCASE
+pattern CategoryLetterLowercase        = #const UTF8_CATEGORY_LETTER_LOWERCASE
+pattern CategoryLetterTitlecase        = #const UTF8_CATEGORY_LETTER_TITLECASE
+pattern CategoryLetterOther            = #const UTF8_CATEGORY_LETTER_OTHER
+pattern CategoryLetter                 = #const UTF8_CATEGORY_LETTER
+pattern CategoryCaseMapped             = #const UTF8_CATEGORY_CASE_MAPPED
 
 pattern CategoryMarkNonSpacing        :: Category  
 pattern CategoryMarkSpacing           :: Category  
 pattern CategoryMarkEnclosing         :: Category  
 pattern CategoryMark                  :: Category  
-pattern CategoryMarkNonSpacing         = Category (#const UTF8_CATEGORY_MARK_NON_SPACING)
-pattern CategoryMarkSpacing            = Category (#const UTF8_CATEGORY_MARK_SPACING)
-pattern CategoryMarkEnclosing          = Category (#const UTF8_CATEGORY_MARK_ENCLOSING)
-pattern CategoryMark                   = Category (#const UTF8_CATEGORY_MARK)
+pattern CategoryMarkNonSpacing         = #const UTF8_CATEGORY_MARK_NON_SPACING
+pattern CategoryMarkSpacing            = #const UTF8_CATEGORY_MARK_SPACING
+pattern CategoryMarkEnclosing          = #const UTF8_CATEGORY_MARK_ENCLOSING
+pattern CategoryMark                   = #const UTF8_CATEGORY_MARK
 
 pattern CategoryNumberDecimal         :: Category 
 pattern CategoryNumberLetter          :: Category 
 pattern CategoryNumberOther           :: Category 
 pattern CategoryNumber                :: Category 
-pattern CategoryNumberDecimal          = Category (#const UTF8_CATEGORY_NUMBER_DECIMAL)
-pattern CategoryNumberLetter           = Category (#const UTF8_CATEGORY_NUMBER_LETTER)
-pattern CategoryNumberOther            = Category (#const UTF8_CATEGORY_NUMBER_OTHER)
-pattern CategoryNumber                 = Category (#const UTF8_CATEGORY_NUMBER)
+pattern CategoryNumberDecimal          = #const UTF8_CATEGORY_NUMBER_DECIMAL
+pattern CategoryNumberLetter           = #const UTF8_CATEGORY_NUMBER_LETTER
+pattern CategoryNumberOther            = #const UTF8_CATEGORY_NUMBER_OTHER
+pattern CategoryNumber                 = #const UTF8_CATEGORY_NUMBER
 
 pattern CategoryPunctuationConnector  :: Category
 pattern CategoryPunctuationDash       :: Category
@@ -105,24 +104,24 @@
 pattern CategoryPunctuationFinal      :: Category
 pattern CategoryPunctuationOther      :: Category
 pattern CategoryPunctuation           :: Category
-pattern CategoryPunctuationConnector   = Category (#const UTF8_CATEGORY_PUNCTUATION_CONNECTOR)
-pattern CategoryPunctuationDash        = Category (#const UTF8_CATEGORY_PUNCTUATION_DASH)
-pattern CategoryPunctuationOpen        = Category (#const UTF8_CATEGORY_PUNCTUATION_OPEN)
-pattern CategoryPunctuationClose       = Category (#const UTF8_CATEGORY_PUNCTUATION_CLOSE)
-pattern CategoryPunctuationInitial     = Category (#const UTF8_CATEGORY_PUNCTUATION_INITIAL)
-pattern CategoryPunctuationFinal       = Category (#const UTF8_CATEGORY_PUNCTUATION_FINAL)
-pattern CategoryPunctuationOther       = Category (#const UTF8_CATEGORY_PUNCTUATION_OTHER)
-pattern CategoryPunctuation            = Category (#const UTF8_CATEGORY_PUNCTUATION)
+pattern CategoryPunctuationConnector   = #const UTF8_CATEGORY_PUNCTUATION_CONNECTOR
+pattern CategoryPunctuationDash        = #const UTF8_CATEGORY_PUNCTUATION_DASH
+pattern CategoryPunctuationOpen        = #const UTF8_CATEGORY_PUNCTUATION_OPEN
+pattern CategoryPunctuationClose       = #const UTF8_CATEGORY_PUNCTUATION_CLOSE
+pattern CategoryPunctuationInitial     = #const UTF8_CATEGORY_PUNCTUATION_INITIAL
+pattern CategoryPunctuationFinal       = #const UTF8_CATEGORY_PUNCTUATION_FINAL
+pattern CategoryPunctuationOther       = #const UTF8_CATEGORY_PUNCTUATION_OTHER
+pattern CategoryPunctuation            = #const UTF8_CATEGORY_PUNCTUATION
 pattern CategorySymbolMath            :: Category 
 pattern CategorySymbolCurrency        :: Category 
 pattern CategorySymbolModifier        :: Category 
 pattern CategorySymbolOther           :: Category 
 pattern CategorySymbol                :: Category 
-pattern CategorySymbolMath             = Category (#const UTF8_CATEGORY_SYMBOL_MATH)
-pattern CategorySymbolCurrency         = Category (#const UTF8_CATEGORY_SYMBOL_CURRENCY)
-pattern CategorySymbolModifier         = Category (#const UTF8_CATEGORY_SYMBOL_MODIFIER)
-pattern CategorySymbolOther            = Category (#const UTF8_CATEGORY_SYMBOL_OTHER)
-pattern CategorySymbol                 = Category (#const UTF8_CATEGORY_SYMBOL)
+pattern CategorySymbolMath             = #const UTF8_CATEGORY_SYMBOL_MATH
+pattern CategorySymbolCurrency         = #const UTF8_CATEGORY_SYMBOL_CURRENCY
+pattern CategorySymbolModifier         = #const UTF8_CATEGORY_SYMBOL_MODIFIER
+pattern CategorySymbolOther            = #const UTF8_CATEGORY_SYMBOL_OTHER
+pattern CategorySymbol                 = #const UTF8_CATEGORY_SYMBOL
 
 pattern CategorySeparatorSpace        :: Category 
 pattern CategorySeparatorLine         :: Category 
@@ -136,18 +135,18 @@
 pattern CategoryCompatibility         :: Category 
 pattern CategoryIgnoreGraphemeCluster :: Category 
 pattern CategoryIscntrl               :: Category 
-pattern CategorySeparatorSpace         = Category (#const UTF8_CATEGORY_SEPARATOR_SPACE)
-pattern CategorySeparatorLine          = Category (#const UTF8_CATEGORY_SEPARATOR_LINE)
-pattern CategorySeparatorParagraph     = Category (#const UTF8_CATEGORY_SEPARATOR_PARAGRAPH)
-pattern CategorySeparator              = Category (#const UTF8_CATEGORY_SEPARATOR)
-pattern CategoryControl                = Category (#const UTF8_CATEGORY_CONTROL)
-pattern CategoryFormat                 = Category (#const UTF8_CATEGORY_FORMAT)
-pattern CategorySurrogate              = Category (#const UTF8_CATEGORY_SURROGATE)
-pattern CategoryPrivateUse             = Category (#const UTF8_CATEGORY_PRIVATE_USE)
-pattern CategoryUnassigned             = Category (#const UTF8_CATEGORY_UNASSIGNED)
-pattern CategoryCompatibility          = Category (#const UTF8_CATEGORY_COMPATIBILITY)
-pattern CategoryIgnoreGraphemeCluster  = Category (#const UTF8_CATEGORY_IGNORE_GRAPHEME_CLUSTER)
-pattern CategoryIscntrl                = Category (#const UTF8_CATEGORY_ISCNTRL)
+pattern CategorySeparatorSpace         = #const UTF8_CATEGORY_SEPARATOR_SPACE
+pattern CategorySeparatorLine          = #const UTF8_CATEGORY_SEPARATOR_LINE
+pattern CategorySeparatorParagraph     = #const UTF8_CATEGORY_SEPARATOR_PARAGRAPH
+pattern CategorySeparator              = #const UTF8_CATEGORY_SEPARATOR
+pattern CategoryControl                = #const UTF8_CATEGORY_CONTROL
+pattern CategoryFormat                 = #const UTF8_CATEGORY_FORMAT
+pattern CategorySurrogate              = #const UTF8_CATEGORY_SURROGATE
+pattern CategoryPrivateUse             = #const UTF8_CATEGORY_PRIVATE_USE
+pattern CategoryUnassigned             = #const UTF8_CATEGORY_UNASSIGNED
+pattern CategoryCompatibility          = #const UTF8_CATEGORY_COMPATIBILITY
+pattern CategoryIgnoreGraphemeCluster  = #const UTF8_CATEGORY_IGNORE_GRAPHEME_CLUSTER
+pattern CategoryIscntrl                = #const UTF8_CATEGORY_ISCNTRL
 
 pattern CategoryIsprint               :: Category
 pattern CategoryIsspace               :: Category
@@ -160,14 +159,14 @@
 pattern CategoryIslower               :: Category
 pattern CategoryIsdigit               :: Category
 pattern CategoryIsxdigit              :: Category
-pattern CategoryIsprint                = Category (#const UTF8_CATEGORY_ISPRINT)
-pattern CategoryIsspace                = Category (#const UTF8_CATEGORY_ISSPACE)
-pattern CategoryIsblank                = Category (#const UTF8_CATEGORY_ISBLANK)
-pattern CategoryIsgraph                = Category (#const UTF8_CATEGORY_ISGRAPH)
-pattern CategoryIspunct                = Category (#const UTF8_CATEGORY_ISPUNCT)
-pattern CategoryIsalnum                = Category (#const UTF8_CATEGORY_ISALNUM)
-pattern CategoryIsalpha                = Category (#const UTF8_CATEGORY_ISALPHA)
-pattern CategoryIsupper                = Category (#const UTF8_CATEGORY_ISUPPER)
-pattern CategoryIslower                = Category (#const UTF8_CATEGORY_ISLOWER)
-pattern CategoryIsdigit                = Category (#const UTF8_CATEGORY_ISDIGIT)
-pattern CategoryIsxdigit               = Category (#const UTF8_CATEGORY_ISXDIGIT)                   
+pattern CategoryIsprint                = #const UTF8_CATEGORY_ISPRINT
+pattern CategoryIsspace                = #const UTF8_CATEGORY_ISSPACE
+pattern CategoryIsblank                = #const UTF8_CATEGORY_ISBLANK
+pattern CategoryIsgraph                = #const UTF8_CATEGORY_ISGRAPH
+pattern CategoryIspunct                = #const UTF8_CATEGORY_ISPUNCT
+pattern CategoryIsalnum                = #const UTF8_CATEGORY_ISALNUM
+pattern CategoryIsalpha                = #const UTF8_CATEGORY_ISALPHA
+pattern CategoryIsupper                = #const UTF8_CATEGORY_ISUPPER
+pattern CategoryIslower                = #const UTF8_CATEGORY_ISLOWER
+pattern CategoryIsdigit                = #const UTF8_CATEGORY_ISDIGIT
+pattern CategoryIsxdigit               = #const UTF8_CATEGORY_ISXDIGIT                   
