]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Type/Char.hs
factorizing Type1_From ast Type0
[haskell/symantic.git] / Language / Symantic / Type / Char.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.Char where
9
10 import qualified Data.MonoTraversable as MT
11 import Data.Proxy
12
13 import Language.Symantic.Type.Root
14 import Language.Symantic.Type.Type0
15 import Language.Symantic.Type.Constraint
16 import Language.Symantic.Type.Family
17
18 -- * Type 'Type_Char'
19 -- | The 'Char' type.
20 type Type_Char = Type0 (Proxy Char)
21
22 pattern Type_Char :: Type_Char root Char
23 pattern Type_Char = Type0 Proxy
24
25 instance Type0_Constraint Eq (Type_Char root) where
26 type0_constraint _c Type0{} = Just Dict
27 instance Type0_Constraint Ord (Type_Char root) where
28 type0_constraint _c Type0{} = Just Dict
29 instance Type0_Constraint Monoid (Type_Char root)
30 instance Type0_Constraint Num (Type_Char root)
31 instance Type0_Constraint Integral (Type_Char root)
32 instance Type0_Family Type_Family_MonoElement (Type_Char root)
33 instance Type0_Constraint MT.MonoFunctor (Type_Char root)
34 instance String_from_Type (Type_Char root) where
35 string_from_type _ = "Char"
36
37 -- | Inject 'Type_Char' within a root type.
38 type_char :: Type_Root_Lift Type_Char root => root Char
39 type_char = type0