1 {-# LANGUAGE FlexibleContexts #-}
3 {-# LANGUAGE MultiParamTypeClasses #-}
4 {-# LANGUAGE OverloadedStrings #-}
5 {-# LANGUAGE ScopedTypeVariables #-}
6 {-# LANGUAGE TypeFamilies #-}
7 {-# LANGUAGE UndecidableInstances #-}
8 module Language.LOL.Symantic.Type.Ordering where
10 import Data.Maybe (isJust)
11 import Data.Type.Equality ((:~:)(Refl))
13 import Language.LOL.Symantic.Type.Common
15 -- * Type 'Type_Ordering'
16 -- | The 'Ordering' type.
17 data Type_Ordering (root:: * -> *) h where
18 Type_Ordering :: Type_Ordering root Ordering
19 type instance Root_of_Type (Type_Ordering root) = root
20 type instance Error_of_Type ast (Type_Ordering root) = ()
23 Type_Eq (Type_Ordering root) where
24 type_eq Type_Ordering Type_Ordering = Just Refl
26 Eq (Type_Ordering root h) where
27 x == y = isJust $ x `type_eq` y
28 instance -- String_from_Type
29 String_from_Type (Type_Ordering root) where
30 string_from_type Type_Ordering = "Ordering"
32 Show (Type_Ordering root h) where
33 show = string_from_type
35 -- | Convenient alias to include a 'Type_Ordering' within a type.
36 type_ordering :: Type_Root_Lift Type_Ordering root => root Ordering
37 type_ordering = type_root_lift Type_Ordering