{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} module Language.Symantic.Type.Ordering where import Data.Maybe (isJust) import Data.Type.Equality ((:~:)(Refl)) import Language.Symantic.Type.Common -- * Type 'Type_Ordering' -- | The 'Ordering' type. data Type_Ordering (root:: * -> *) h where Type_Ordering :: Type_Ordering root Ordering type instance Root_of_Type (Type_Ordering root) = root type instance Error_of_Type ast (Type_Ordering root) = No_Error_Type instance -- Eq_Type Eq_Type (Type_Ordering root) where eq_type Type_Ordering Type_Ordering = Just Refl instance -- Eq Eq (Type_Ordering root h) where x == y = isJust $ x `eq_type` y instance -- String_from_Type String_from_Type (Type_Ordering root) where string_from_type Type_Ordering = "Ordering" instance -- Show Show (Type_Ordering root h) where show = string_from_type -- | Convenient alias to include a 'Type_Ordering' within a type. type_ordering :: Type_Root_Lift Type_Ordering root => root Ordering type_ordering = type_root_lift Type_Ordering