{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-missing-methods #-} module Language.Symantic.Type.Int where import Data.Maybe (isJust) import Data.Type.Equality ((:~:)(Refl)) import Language.Symantic.Type.Common -- * Type 'Type_Int' -- | The 'Int' type. data Type_Int (root:: * -> *) h where Type_Int :: Type_Int root Int type instance Root_of_Type (Type_Int root) = root type instance Error_of_Type ast (Type_Int root) = No_Error_Type instance -- Eq_Type Eq_Type (Type_Int root) where eq_type Type_Int Type_Int = Just Refl instance -- Eq Eq (Type_Int root h) where x == y = isJust $ x `eq_type` y instance -- String_from_Type String_from_Type (Type_Int root) where string_from_type Type_Int = "Int" instance -- Show Show (Type_Int root h) where show = string_from_type instance Constraint_Type Eq (Type_Int root) where constraint_type _c Type_Int = Just Dict instance Constraint_Type Ord (Type_Int root) where constraint_type _c Type_Int = Just Dict instance Unlift_Type1 Type_Int instance Eq_Type1 (Type_Int root) -- | Convenient alias to include a 'Type_Int' within a type. type_int :: Type_Root_Lift Type_Int root => root Int type_int = type_root_lift Type_Int