]> Git — Sourcephile - comptalang.git/blob - lcc/Hcompta/LCC/Name.hs
Rewrite hcompta-lcc to use symantic-grammar.
[comptalang.git] / lcc / Hcompta / LCC / Name.hs
1 {-# LANGUAGE DeriveDataTypeable #-}
2 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
3 {-# LANGUAGE TypeFamilies #-}
4 {-# OPTIONS_GHC -fno-warn-orphans #-}
5 module Hcompta.LCC.Name where
6
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
17
18 -- * Type 'Name'
19 newtype Name = Name Text
20 deriving (Data, Eq, MT.MonoFoldable, Ord, NFData, Show, Typeable)
21 type instance MT.Element Name = Char
22 {-
23 instance NFData s => NFData (NonNull s) where
24 rnf s = rnf (toNullable s)
25 -}
26 unName :: Name -> Text
27 unName (Name n) = n