diff options
author | Iavor S. Diatchki <iavor.diatchki@gmail.com> | 2012-04-30 23:08:54 -0700 |
---|---|---|
committer | Iavor S. Diatchki <iavor.diatchki@gmail.com> | 2012-04-30 23:08:54 -0700 |
commit | 9c11265dc1285bce588761f8b4a7cff2a12259ae (patch) | |
tree | d9034c74dfc440eb451282125b0fd3ffcaf4f872 /libraries/base/GHC/TypeLits.hs | |
parent | 77193449394cdaeeac706f7009fc61c586c7cb1e (diff) | |
download | haskell-9c11265dc1285bce588761f8b4a7cff2a12259ae.tar.gz |
Add a type-family for comparing numbers.
For the moment, this replaces the class (<=) because it is
easier to fit with GHC's coercion evidence.
Diffstat (limited to 'libraries/base/GHC/TypeLits.hs')
-rw-r--r-- | libraries/base/GHC/TypeLits.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libraries/base/GHC/TypeLits.hs b/libraries/base/GHC/TypeLits.hs index 984fd391f0..8b4e13b630 100644 --- a/libraries/base/GHC/TypeLits.hs +++ b/libraries/base/GHC/TypeLits.hs @@ -23,7 +23,7 @@ module GHC.TypeLits , withSing, singThat -- * Functions on type nats - , type (<=), type (+), type (*), type (^) + , type (<=), type (<=?), type (+), type (*), type (^) -- * Destructing type-nats. , isZero, IsZero(..) @@ -76,6 +76,8 @@ class SingI a where -- | Comparsion of type-level naturals. class (m :: Nat) <= (n :: Nat) +type family (m :: Nat) <=? (n :: Nat) :: Bool + -- | Addition of type-level naturals. type family (m :: Nat) + (n :: Nat) :: Nat |