{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Hcompta.LCC.Name where

import Control.DeepSeq (NFData(..))
import Data.Char (Char)
import Data.Data (Data(..))
import Data.Eq (Eq(..))
-- import Data.NonNull (NonNull, toNullable)
import Data.Ord (Ord(..))
import Data.Text (Text)
import Data.Typeable (Typeable)
import Text.Show (Show)
import qualified Data.MonoTraversable as MT

-- * 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