]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Type/Ordering.hs
Repr_Dup helpers
[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
12 import Language.Symantic.Type.Root
13 import Language.Symantic.Type.Type0
14 import Language.Symantic.Type.Constraint
15 import Language.Symantic.Type.Family
16
17 -- * Type 'Type_Ordering'
18 -- | The 'Ordering' type.
19 type Type_Ordering = Type0 (Proxy Ordering)
20
21 pattern Type_Ordering :: Type_Ordering root Ordering
22 pattern Type_Ordering = Type0 Proxy
23
24 instance Type0_Constraint Eq (Type_Ordering root) where
25 type0_constraint _c Type0{} = Just Dict
26 instance Type0_Constraint Ord (Type_Ordering root) where
27 type0_constraint _c Type0{} = Just Dict
28 instance Type0_Constraint Monoid (Type_Ordering root)
29 instance Type0_Constraint Num (Type_Ordering root)
30 instance Type0_Constraint Integral (Type_Ordering root)
31 instance Type0_Constraint MT.MonoFunctor (Type_Ordering root)
32 instance Type0_Family Type_Family_MonoElement (Type_Ordering root)
33 instance String_from_Type (Type_Ordering root) where
34 string_from_type _ = "Ordering"
35
36 -- | Inject 'Type_Ordering' within a root type.
37 type_ordering :: Type_Root_Lift Type_Ordering root => root Ordering
38 type_ordering = type0