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