]> Git — Sourcephile - comptalang.git/blob - lcc/Hcompta/LCC/Name.hs
Working REPL, with IO support.
[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
22 type instance MT.Element Name = Char
23
24 {-
25 instance NFData s => NFData (NonNull s) where
26 rnf s = rnf (toNullable s)
27 -}
28
29 unName :: Name -> Text
30 unName (Name n) = n