{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Hcompta.LCC.Name where import Control.DeepSeq (NFData(..)) import Data.Data (Data(..)) import Data.Char (Char) import Data.Eq (Eq(..)) import qualified Data.MonoTraversable as MT import Data.NonNull (NonNull, toNullable) import Data.Ord (Ord(..)) import Data.Text (Text) import Data.Typeable (Typeable) import Text.Show (Show) -- * Type 'Name' newtype Name = Name Text deriving (Data, Eq, MT.MonoFoldable, Ord, NFData, Show, Typeable) type instance MT.Element Name = Char instance NFData s => NFData (NonNull s) where rnf s = rnf (toNullable s) unName :: Name -> Text unName (Name n) = n