]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Type/Bool.hs
MonoFunctor
[haskell/symantic.git] / Language / Symantic / Type / Bool.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.Bool where
9
10 import Data.Proxy
11 import Language.Symantic.Type.Root
12 import Language.Symantic.Type.Type0
13 import qualified Data.MonoTraversable as MT
14
15 -- * Type 'Type_Bool'
16 -- | The 'Bool' type.
17 type Type_Bool = Type_Type0 (Proxy Bool)
18
19 pattern Type_Bool :: Type_Bool root Bool
20 pattern Type_Bool = Type_Type0 Proxy
21
22 instance Constraint_Type Eq (Type_Bool root) where
23 constraint_type _c Type_Type0{} = Just Dict
24 instance Constraint_Type Ord (Type_Bool root) where
25 constraint_type _c Type_Type0{} = Just Dict
26 instance Constraint_Type Monoid (Type_Bool root)
27 instance Constraint_Type Num (Type_Bool root)
28 instance Constraint_Type Integral (Type_Bool root)
29 instance Constraint_Type MT.MonoFunctor (Type_Bool root)
30 instance String_from_Type (Type_Bool root) where
31 string_from_type _ = "Bool"
32
33 -- | Inject 'Type_Bool' within a root type.
34 type_bool :: Lift_Type_Root Type_Bool root => root Bool
35 type_bool = type_type0