{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} module Language.Symantic.Type.Bool where import Data.Maybe (isJust) import Data.Type.Equality ((:~:)(Refl)) import Language.Symantic.Type.Common -- * Type 'Type_Bool' -- | The 'Bool' type. data Type_Bool (root:: * -> *) h where Type_Bool :: Type_Bool root Bool type instance Root_of_Type (Type_Bool root) = root type instance Error_of_Type ast (Type_Bool root) = No_Error_Type instance -- Type_Eq Type_Eq (Type_Bool root) where type_eq Type_Bool Type_Bool = Just Refl instance -- Eq Eq (Type_Bool root h) where x == y = isJust $ x `type_eq` y instance -- String_from_Type String_from_Type (Type_Bool root) where string_from_type Type_Bool = "Bool" instance -- Show Show (Type_Bool root h) where show = string_from_type instance Type_Constraint Eq (Type_Bool root) where type_constraint _c Type_Bool = Just Dict instance Type_Constraint Ord (Type_Bool root) where type_constraint _c Type_Bool = Just Dict -- | Convenient alias to include a 'Type_Bool' within a type. type_bool :: Type_Root_Lift Type_Bool root => root Bool type_bool = type_root_lift Type_Bool