{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Language.Symantic.Type.Integer where import Data.Proxy import Language.Symantic.Type.Root import Language.Symantic.Type.Type0 -- * Type 'Type_Integer' -- | The 'Integer' type. type Type_Integer = Type_Type0 (Proxy Integer) pattern Type_Integer :: Type_Integer root Integer pattern Type_Integer = Type_Type0 Proxy instance Constraint_Type Eq (Type_Integer root) where constraint_type _c Type_Type0{} = Just Dict instance Constraint_Type Ord (Type_Integer root) where constraint_type _c Type_Type0{} = Just Dict instance Constraint_Type Monoid (Type_Integer root) instance Constraint_Type Num (Type_Integer root) where constraint_type _c Type_Type0{} = Just Dict instance Constraint_Type Integral (Type_Integer root) where constraint_type _c Type_Type0{} = Just Dict instance String_from_Type (Type_Integer root) where string_from_type _ = "Integer" -- | Inject 'Type_Integer' within a root type. type_integer :: Lift_Type_Root Type_Integer root => root Integer type_integer = type_type0