]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Type/Ordering.hs
MonoFunctor
[haskell/symantic.git] / Language / Symantic / Type / Ordering.hs
1 {-# LANGUAGE FlexibleContexts #-}
2 {-# LANGUAGE FlexibleInstances #-}
3 {-# LANGUAGE MultiParamTypeClasses #-}
4 {-# LANGUAGE PatternSynonyms #-}
5 {-# LANGUAGE TypeFamilies #-}
6 {-# OPTIONS_GHC -fno-warn-orphans #-}
7 module Language.Symantic.Type.Ordering where
8
9 import qualified Data.MonoTraversable as MT
10 import Data.Proxy
11 import Language.Symantic.Type.Root
12 import Language.Symantic.Type.Type0
13
14 -- * Type 'Type_Ordering'
15 -- | The 'Ordering' type.
16 type Type_Ordering = Type_Type0 (Proxy Ordering)
17
18 pattern Type_Ordering :: Type_Ordering root Ordering
19 pattern Type_Ordering = Type_Type0 Proxy
20
21 instance Constraint_Type Eq (Type_Ordering root) where
22 constraint_type _c Type_Type0{} = Just Dict
23 instance Constraint_Type Ord (Type_Ordering root) where
24 constraint_type _c Type_Type0{} = Just Dict
25 instance Constraint_Type Monoid (Type_Ordering root)
26 instance Constraint_Type Num (Type_Ordering root)
27 instance Constraint_Type Integral (Type_Ordering root)
28 instance Constraint_Type MT.MonoFunctor (Type_Ordering root)
29 instance String_from_Type (Type_Ordering root) where
30 string_from_type _ = "Ordering"
31
32 -- | Inject 'Type_Ordering' within a root type.
33 type_ordering :: Lift_Type_Root Type_Ordering root => root Ordering
34 type_ordering = type_type0