1 {-# LANGUAGE DeriveDataTypeable #-}
2 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
3 {-# LANGUAGE TypeFamilies #-}
4 {-# OPTIONS_GHC -fno-warn-orphans #-}
5 module Hcompta.LCC.Name where
7 import Control.DeepSeq (NFData(..))
8 import Data.Char (Char)
9 import Data.Data (Data(..))
10 import Data.Eq (Eq(..))
11 -- import Data.NonNull (NonNull, toNullable)
12 import Data.Ord (Ord(..))
13 import Data.Text (Text)
14 import Data.Typeable (Typeable)
15 import Text.Show (Show)
16 import qualified Data.MonoTraversable as MT
19 newtype Name = Name Text
20 deriving (Data, Eq, MT.MonoFoldable, Ord, NFData, Show, Typeable)
22 type instance MT.Element Name = Char
25 instance NFData s => NFData (NonNull s) where
26 rnf s = rnf (toNullable s)
29 unName :: Name -> Text