]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Type/Text.hs
Integer, Integral, Num
[haskell/symantic.git] / Language / Symantic / Type / Text.hs
1 {-# LANGUAGE FlexibleContexts #-}
2 {-# LANGUAGE FlexibleInstances #-}
3 {-# LANGUAGE MultiParamTypeClasses #-}
4 {-# LANGUAGE PatternSynonyms #-}
5 {-# LANGUAGE ScopedTypeVariables #-}
6 {-# LANGUAGE TypeFamilies #-}
7 {-# OPTIONS_GHC -fno-warn-orphans #-}
8 module Language.Symantic.Type.Text where
9
10 import Data.Proxy
11 import Data.Text (Text)
12 import Language.Symantic.Type.Root
13 import Language.Symantic.Type.Type0
14
15 -- * Type 'Type_Text'
16 -- | The 'Text' type.
17 type Type_Text = Type_Type0 (Proxy Text)
18
19 pattern Type_Text :: Type_Type0 (Proxy Text) root Text
20 pattern Type_Text = Type_Type0 Proxy
21
22 instance Constraint_Type Eq (Type_Text root) where
23 constraint_type _c Type_Type0{} = Just Dict
24 instance Constraint_Type Ord (Type_Text root) where
25 constraint_type _c Type_Type0{} = Just Dict
26 instance Constraint_Type Monoid (Type_Text root) where
27 constraint_type _c Type_Type0{} = Just Dict
28 instance Constraint_Type Num (Type_Text root)
29 instance Constraint_Type Integral (Type_Text root)
30 instance -- String_from_Type
31 String_from_Type (Type_Text root) where
32 string_from_type _ = "Text"
33
34 -- | Inject 'Type_Text' within a root type.
35 type_text :: Lift_Type_Root Type_Text root => root Text
36 type_text = type_type0