Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Data/Text/ICU/CaseMap.hsc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# LANGUAGE DeriveDataTypeable, EmptyDataDecls, ForeignFunctionInterface #-}
{-# LANGUAGE EmptyDataDecls, ForeignFunctionInterface #-}
-- |
-- Module : Data.Text.ICU.CaseMap
-- Copyright : (c) 2010 Bryan O'Sullivan
Expand Down Expand Up @@ -26,7 +26,6 @@ import Data.Bits ((.|.))
import Data.List (foldl')
import Data.Text.ICU.Error.Internal (UErrorCode, handleError)
import Data.Text.ICU.Internal (LocaleName, withLocaleName)
import Data.Typeable (Typeable)
import Data.Word (Word32)
import Foreign.C.String (CString)
import Foreign.ForeignPtr (ForeignPtr)
Expand All @@ -36,7 +35,7 @@ import System.IO.Unsafe (unsafePerformIO)
data UCaseMap

data CaseMap = CaseMap {-# UNPACK #-} !(ForeignPtr UCaseMap)
deriving (Eq, Typeable)
deriving (Eq)

data CaseOption = FoldCaseExcludeSpecialI
| TitleCaseNoLowerCase
Expand Down
73 changes: 36 additions & 37 deletions Data/Text/ICU/Char.hsc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# LANGUAGE BangPatterns, DeriveDataTypeable, FlexibleInstances,
{-# LANGUAGE BangPatterns, FlexibleInstances,
ForeignFunctionInterface, FunctionalDependencies, MultiParamTypeClasses #-}

-- |
Expand Down Expand Up @@ -93,7 +93,6 @@ import Data.Text.ICU.Error (u_INVALID_CHAR_FOUND)
import Data.Text.ICU.Error.Internal (UErrorCode, handleOverflowError, withError)
import Data.Text.ICU.Internal (UBool, UChar32, asBool)
import Data.Text.ICU.Normalize.Internal (toNCR)
import Data.Typeable (Typeable)
import Data.Word (Word8)
import Foreign.C.String (CString, peekCStringLen, withCString)
import Foreign.C.Types (CInt(..))
Expand Down Expand Up @@ -135,7 +134,7 @@ data Direction =
| LeftToRightIsolate
| RightToLeftIsolate
| PopDirectionalIsolate
deriving (Eq, Enum, Show, Typeable)
deriving (Eq, Enum, Show)

instance NFData Direction where
rnf !_ = ()
Expand Down Expand Up @@ -492,7 +491,7 @@ data BlockCode =
| Kawi
| NagMundari

deriving (Eq, Enum, Bounded, Show, Typeable)
deriving (Eq, Enum, Bounded, Show)

instance NFData BlockCode where
rnf !_ = ()
Expand Down Expand Up @@ -636,7 +635,7 @@ data Bool_ =
| RgiEmojiTagSequence -- ^ See https://www.unicode.org/reports/tr51/#Emoji_Sets
| RgiEmojiZwjSequence -- ^ See https://www.unicode.org/reports/tr51/#Emoji_Sets
| RgiEmoji -- ^ See https://www.unicode.org/reports/tr51/#Emoji_Sets
deriving (Eq, Enum, Show, Typeable)
deriving (Eq, Enum, Show)

instance NFData Bool_ where
rnf !_ = ()
Expand All @@ -645,7 +644,7 @@ class Property p v | p -> v where
fromNative :: p -> Int32 -> v
toUProperty :: p -> UProperty

data BidiClass_ = BidiClass deriving (Show, Typeable)
data BidiClass_ = BidiClass deriving (Show)

instance NFData BidiClass_ where
rnf !_ = ()
Expand All @@ -663,7 +662,7 @@ instance Property Block_ BlockCode where
fromNative _ = toEnum . fromIntegral
toUProperty _ = (#const UCHAR_BLOCK)

data CanonicalCombiningClass_ = CanonicalCombiningClass deriving (Show,Typeable)
data CanonicalCombiningClass_ = CanonicalCombiningClass deriving (Show)

instance NFData CanonicalCombiningClass_ where
rnf !_ = ()
Expand All @@ -672,7 +671,7 @@ instance Property CanonicalCombiningClass_ Int where
fromNative _ = fromIntegral
toUProperty _ = (#const UCHAR_CANONICAL_COMBINING_CLASS)

data Decomposition_ = Decomposition deriving (Show, Typeable)
data Decomposition_ = Decomposition deriving (Show)

instance NFData Decomposition_ where
rnf !_ = ()
Expand All @@ -696,7 +695,7 @@ data Decomposition =
| Vertical
| Wide
| Count
deriving (Eq, Enum, Show, Typeable)
deriving (Eq, Enum, Show)

instance NFData Decomposition where
rnf !_ = ()
Expand All @@ -705,7 +704,7 @@ instance Property Decomposition_ (Maybe Decomposition) where
fromNative _ = maybeEnum
toUProperty _ = (#const UCHAR_DECOMPOSITION_TYPE)

data EastAsianWidth_ = EastAsianWidth deriving (Show, Typeable)
data EastAsianWidth_ = EastAsianWidth deriving (Show)

instance NFData EastAsianWidth_ where
rnf !_ = ()
Expand All @@ -717,7 +716,7 @@ data EastAsianWidth = EANeutral
| EANarrow
| EAWide
| EACount
deriving (Eq, Enum, Show, Typeable)
deriving (Eq, Enum, Show)

instance NFData EastAsianWidth where
rnf !_ = ()
Expand All @@ -730,7 +729,7 @@ instance Property Bool_ Bool where
fromNative _ = (/=0)
toUProperty = fromIntegral . fromEnum

data GeneralCategory_ = GeneralCategory deriving (Show, Typeable)
data GeneralCategory_ = GeneralCategory deriving (Show)

instance NFData GeneralCategory_ where
rnf !_ = ()
Expand Down Expand Up @@ -766,7 +765,7 @@ data GeneralCategory =
| OtherSymbol
| InitialPunctuation
| FinalPunctuation
deriving (Eq, Enum, Show, Typeable)
deriving (Eq, Enum, Show)

instance NFData GeneralCategory where
rnf !_ = ()
Expand All @@ -775,7 +774,7 @@ instance Property GeneralCategory_ GeneralCategory where
fromNative _ = toEnum . fromIntegral
toUProperty _ = (#const UCHAR_GENERAL_CATEGORY)

data JoiningGroup_ = JoiningGroup deriving (Show, Typeable)
data JoiningGroup_ = JoiningGroup deriving (Show)

instance NFData JoiningGroup_ where
rnf !_ = ()
Expand Down Expand Up @@ -870,7 +869,7 @@ data JoiningGroup =
| ManichaeanYodh
| ManichaeanZayin
| StraightWaw
deriving (Eq, Enum, Show, Typeable)
deriving (Eq, Enum, Show)

instance NFData JoiningGroup where
rnf !_ = ()
Expand All @@ -879,7 +878,7 @@ instance Property JoiningGroup_ (Maybe JoiningGroup) where
fromNative _ = maybeEnum
toUProperty _ = (#const UCHAR_JOINING_GROUP)

data JoiningType_ = JoiningType deriving (Show, Typeable)
data JoiningType_ = JoiningType deriving (Show)

instance NFData JoiningType_ where
rnf !_ = ()
Expand All @@ -890,7 +889,7 @@ data JoiningType =
| LeftJoining
| RightJoining
| Transparent
deriving (Eq, Enum, Show, Typeable)
deriving (Eq, Enum, Show)

instance NFData JoiningType where
rnf !_ = ()
Expand All @@ -899,7 +898,7 @@ instance Property JoiningType_ (Maybe JoiningType) where
fromNative _ = maybeEnum
toUProperty _ = (#const UCHAR_JOINING_TYPE)

data LineBreak_ = LineBreak deriving (Show, Typeable)
data LineBreak_ = LineBreak deriving (Show)

instance NFData LineBreak_ where
rnf !_ = ()
Expand Down Expand Up @@ -947,7 +946,7 @@ data LineBreak =
| EBase
| EModifier
| ZWJ
deriving (Eq, Enum, Show, Typeable)
deriving (Eq, Enum, Show)

instance NFData LineBreak where
rnf !_ = ()
Expand All @@ -956,13 +955,13 @@ instance Property LineBreak_ (Maybe LineBreak) where
fromNative _ = maybeEnum
toUProperty _ = (#const UCHAR_LINE_BREAK)

data NumericType_ = NumericType deriving (Show, Typeable)
data NumericType_ = NumericType deriving (Show)

instance NFData NumericType_ where
rnf !_ = ()

data NumericType = NTDecimal | NTDigit | NTNumeric
deriving (Eq, Enum, Show, Typeable)
deriving (Eq, Enum, Show)

instance NFData NumericType where
rnf !_ = ()
Expand All @@ -971,7 +970,7 @@ instance Property NumericType_ (Maybe NumericType) where
fromNative _ = maybeEnum
toUProperty _ = (#const UCHAR_NUMERIC_TYPE)

data HangulSyllableType_ = HangulSyllableType deriving (Show, Typeable)
data HangulSyllableType_ = HangulSyllableType deriving (Show)

instance NFData HangulSyllableType_ where
rnf !_ = ()
Expand All @@ -982,7 +981,7 @@ data HangulSyllableType =
| TrailingJamo
| LVSyllable
| LVTSyllable
deriving (Eq, Enum, Show, Typeable)
deriving (Eq, Enum, Show)

instance NFData HangulSyllableType where
rnf !_ = ()
Expand All @@ -991,10 +990,10 @@ instance Property HangulSyllableType_ (Maybe HangulSyllableType) where
fromNative _ = maybeEnum
toUProperty _ = (#const UCHAR_HANGUL_SYLLABLE_TYPE)

data NFCQuickCheck_ = NFCQuickCheck deriving (Show, Typeable)
data NFDQuickCheck_ = NFDQuickCheck deriving (Show, Typeable)
data NFKCQuickCheck_ = NFKCQuickCheck deriving (Show, Typeable)
data NFKDQuickCheck_ = NFKDQuickCheck deriving (Show, Typeable)
data NFCQuickCheck_ = NFCQuickCheck deriving (Show)
data NFDQuickCheck_ = NFDQuickCheck deriving (Show)
data NFKCQuickCheck_ = NFKCQuickCheck deriving (Show)
data NFKDQuickCheck_ = NFKDQuickCheck deriving (Show)

instance NFData NFCQuickCheck_ where
rnf !_ = ()
Expand Down Expand Up @@ -1025,7 +1024,7 @@ instance Property NFKDQuickCheck_ (Maybe Bool) where
toUProperty _ = (#const UCHAR_NFKD_QUICK_CHECK)

data LeadCanonicalCombiningClass_ = LeadCanonicalCombiningClass
deriving (Show, Typeable)
deriving (Show)

instance NFData LeadCanonicalCombiningClass_ where
rnf !_ = ()
Expand All @@ -1035,7 +1034,7 @@ instance Property LeadCanonicalCombiningClass_ Int where
toUProperty _ = (#const UCHAR_LEAD_CANONICAL_COMBINING_CLASS)

data TrailingCanonicalCombiningClass_ = TrailingCanonicalCombiningClass
deriving (Show, Typeable)
deriving (Show)

instance NFData TrailingCanonicalCombiningClass_ where
rnf !_ = ()
Expand All @@ -1044,7 +1043,7 @@ instance Property TrailingCanonicalCombiningClass_ Int where
fromNative _ = fromIntegral
toUProperty _ = (#const UCHAR_TRAIL_CANONICAL_COMBINING_CLASS)

data GraphemeClusterBreak_ = GraphemeClusterBreak deriving (Show, Typeable)
data GraphemeClusterBreak_ = GraphemeClusterBreak deriving (Show)

instance NFData GraphemeClusterBreak_ where
rnf !_ = ()
Expand All @@ -1067,7 +1066,7 @@ data GraphemeClusterBreak =
| GCBEModifier
| GCBGlueAfterZWJ
| GCBZWJ
deriving (Eq, Enum, Show, Typeable)
deriving (Eq, Enum, Show)

instance NFData GraphemeClusterBreak where
rnf !_ = ()
Expand All @@ -1076,7 +1075,7 @@ instance Property GraphemeClusterBreak_ (Maybe GraphemeClusterBreak) where
fromNative _ = maybeEnum
toUProperty _ = (#const UCHAR_GRAPHEME_CLUSTER_BREAK)

data SentenceBreak_ = SentenceBreak deriving (Show, Typeable)
data SentenceBreak_ = SentenceBreak deriving (Show)

instance NFData SentenceBreak_ where
rnf !_ = ()
Expand All @@ -1096,7 +1095,7 @@ data SentenceBreak =
| SBExtend
| SBLF
| SBSContinue
deriving (Eq, Enum, Show, Typeable)
deriving (Eq, Enum, Show)

instance NFData SentenceBreak where
rnf !_ = ()
Expand All @@ -1105,7 +1104,7 @@ instance Property SentenceBreak_ (Maybe SentenceBreak) where
fromNative _ = maybeEnum
toUProperty _ = (#const UCHAR_SENTENCE_BREAK)

data WordBreak_ = WordBreak deriving (Show, Typeable)
data WordBreak_ = WordBreak deriving (Show)

instance NFData WordBreak_ where
rnf !_ = ()
Expand All @@ -1127,7 +1126,7 @@ data WordBreak =
| WBHebrewLetter
| WBSingleQuote
| WBDoubleQuote
deriving (Eq, Enum, Show, Typeable)
deriving (Eq, Enum, Show)

instance NFData WordBreak where
rnf !_ = ()
Expand All @@ -1136,7 +1135,7 @@ instance Property WordBreak_ (Maybe WordBreak) where
fromNative _ = maybeEnum
toUProperty _ = (#const UCHAR_WORD_BREAK)

data BidiPairedBracketType_ = BidiPairedBracketType deriving (Show, Typeable)
data BidiPairedBracketType_ = BidiPairedBracketType deriving (Show)

instance NFData BidiPairedBracketType_ where
rnf !_ = ()
Expand All @@ -1145,7 +1144,7 @@ data BidiPairedBracketType =
BPTNone
| BPTOpen
| BPTClose
deriving (Eq, Enum, Show, Typeable)
deriving (Eq, Enum, Show)

instance NFData BidiPairedBracketType where
rnf !_ = ()
Expand Down
6 changes: 2 additions & 4 deletions Data/Text/ICU/CharsetDetection/Internal.hsc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# LANGUAGE DeriveDataTypeable, ForeignFunctionInterface, EmptyDataDecls #-}
{-# LANGUAGE ForeignFunctionInterface, EmptyDataDecls #-}
-- |
-- Module : Data.Text.ICU.CharsetDetection.Internal
-- Copyright : (c) 2017 Zac Slade
Expand Down Expand Up @@ -27,7 +27,6 @@ module Data.Text.ICU.CharsetDetection.Internal
, withCharsetMatch
) where

import Data.Typeable (Typeable)
import Foreign.ForeignPtr (ForeignPtr, withForeignPtr)
import Foreign.Ptr (FunPtr, Ptr)

Expand All @@ -45,7 +44,7 @@ data UCharsetDetector
-- management of the pointers.
data CharsetDetector = CharsetDetector {
charsetDetectorPtr :: {-# UNPACK #-} !(ForeignPtr UCharsetDetector)
} deriving (Typeable)
}

mkCharsetDetector :: IO CharsetDetector
mkCharsetDetector = wrapUCharsetDetector $ handleError ucsdet_open
Expand Down Expand Up @@ -75,7 +74,6 @@ data CharsetMatch =
-- ^ keep reference since UCharsetMatch object is owned
-- by the UCharsetDetector.
}
deriving (Typeable)

wrapUCharsetMatch :: CharsetDetector -> IO (Ptr UCharsetMatch) -> IO CharsetMatch
wrapUCharsetMatch cd = fmap $ flip CharsetMatch cd
Expand Down
Loading
Loading