]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Type/Text.hs
Map
[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 import Language.Symantic.Type.Type1
15
16 -- * Type 'Type_Text'
17 -- | The 'Text' type.
18 type Type_Text = Type_Type0 (Proxy Text)
19
20 pattern Type_Text :: Type_Type0 (Proxy Text) root Text
21 pattern Type_Text = Type_Type0 Proxy
22
23 instance Constraint_Type Eq (Type_Text root) where
24 constraint_type _c Type_Type0{} = Just Dict
25 instance Constraint_Type Ord (Type_Text root) where
26 constraint_type _c Type_Type0{} = Just Dict
27 instance Constraint_Type Monoid (Type_Text root) where
28 constraint_type _c Type_Type0{} = Just Dict
29 instance Constraint_Type1 Functor (Type_Text root)
30 instance Constraint_Type1 Applicative (Type_Text root)
31 instance Constraint_Type1 Foldable (Type_Text root)
32 instance Constraint_Type1 Traversable (Type_Text root)
33 instance Constraint_Type1 Monad (Type_Text root)
34 instance -- String_from_Type
35 String_from_Type (Type_Text root) where
36 string_from_type _ = "Text"
37
38 -- | Inject 'Type_Text' within a root type.
39 type_text :: Lift_Type_Root Type_Text root => root Text
40 type_text = type_type0