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.Integer where
10 import qualified Data.MonoTraversable as MT
13 import Language.Symantic.Type.Root
14 import Language.Symantic.Type.Type0
15 import Language.Symantic.Type.Constraint
16 import Language.Symantic.Type.Family
18 -- * Type 'Type_Integer'
19 -- | The 'Integer' type.
20 type Type_Integer = Type0 (Proxy Integer)
22 pattern Type_Integer :: Type_Integer root Integer
23 pattern Type_Integer = Type0 Proxy
25 instance Type0_Constraint Eq (Type_Integer root) where
26 type0_constraint _c Type0{} = Just Dict
27 instance Type0_Constraint Ord (Type_Integer root) where
28 type0_constraint _c Type0{} = Just Dict
29 instance Type0_Constraint Monoid (Type_Integer root)
30 instance Type0_Constraint Num (Type_Integer root) where
31 type0_constraint _c Type0{} = Just Dict
32 instance Type0_Constraint Integral (Type_Integer root) where
33 type0_constraint _c Type0{} = Just Dict
34 instance Type0_Constraint MT.MonoFunctor (Type_Integer root)
35 instance Type0_Family Type_Family_MonoElement (Type_Integer root)
36 instance String_from_Type (Type_Integer root) where
37 string_from_type _ = "Integer"
39 -- | Inject 'Type_Integer' within a root type.
40 type_integer :: Type_Root_Lift Type_Integer root => root Integer