]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Type/Char.hs
MonoFunctor
[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
16 -- * Type 'Type_Char'
17 -- | The 'Char' type.
18 type Type_Char = Type_Type0 (Proxy Char)
19
20 pattern Type_Char :: Type_Char root Char
21 pattern Type_Char = Type_Type0 Proxy
22
23 instance Constraint_Type Eq (Type_Char root) where
24 constraint_type _c Type_Type0{} = Just Dict
25 instance Constraint_Type Ord (Type_Char root) where
26 constraint_type _c Type_Type0{} = Just Dict
27 instance Constraint_Type Monoid (Type_Char root)
28 instance Constraint_Type Num (Type_Char root)
29 instance Constraint_Type Integral (Type_Char root)
30 instance Constraint_Type MT.MonoFunctor (Type_Char root)
31 instance String_from_Type (Type_Char root) where
32 string_from_type _ = "Char"
33
34 -- | Inject 'Type_Char' within a root type.
35 type_char :: Lift_Type_Root Type_Char root => root Char
36 type_char = type_type0