{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
module Data.Type.Nat.LT (
LT (..),
LTProof,
withLTProof,
ltReflAbsurd,
ltSymAbsurd,
ltTrans,
) where
import Data.Type.Nat
import Data.Type.Nat.LE
type LTProof n m = LEProof ('S n) m
class LT (n :: Nat) (m :: Nat) where
ltProof :: LTProof n m
instance LE ('S n) m => LT n m where
ltProof :: LTProof n m
ltProof = LTProof n m
forall (n :: Nat) (m :: Nat). LE n m => LEProof n m
leProof
withLTProof :: LTProof n m -> (LT n m => r) -> r
withLTProof :: LTProof n m -> (LT n m => r) -> r
withLTProof LTProof n m
p LT n m => r
f = LTProof n m -> (LE ('S n) m => r) -> r
forall (n :: Nat) (m :: Nat) r. LEProof n m -> (LE n m => r) -> r
withLEProof LTProof n m
p LE ('S n) m => r
LT n m => r
f
ltReflAbsurd :: LTProof n n -> a
ltReflAbsurd :: LTProof n n -> a
ltReflAbsurd (LESucc LEProof n m
p) = LTProof m m -> a
forall (n :: Nat) a. LTProof n n -> a
ltReflAbsurd LEProof n m
LTProof m m
p
ltSymAbsurd :: LTProof n m -> LTProof m n -> a
ltSymAbsurd :: LTProof n m -> LTProof m n -> a
ltSymAbsurd (LESucc LEProof n m
p) (LESucc LEProof n m
q) = LTProof m m -> LTProof m m -> a
forall (n :: Nat) (m :: Nat) a. LTProof n m -> LTProof m n -> a
ltSymAbsurd LEProof n m
LTProof m m
p LEProof n m
LTProof m m
q
ltTrans :: LTProof n m -> LTProof m p -> LTProof n p
ltTrans :: LTProof n m -> LTProof m p -> LTProof n p
ltTrans LTProof n m
p (LESucc LEProof n m
q) = LEProof ('S n) m -> LEProof ('S n) ('S m)
forall (n :: Nat) (m :: Nat). LEProof n m -> LEProof n ('S m)
leStep (LEProof ('S n) m -> LEProof ('S n) ('S m))
-> LEProof ('S n) m -> LEProof ('S n) ('S m)
forall a b. (a -> b) -> a -> b
$ LTProof n m -> LEProof m m -> LEProof ('S n) m
forall (n :: Nat) (m :: Nat) (p :: Nat).
LEProof n m -> LEProof m p -> LEProof n p
leTrans LTProof n m
p LEProof m m
LEProof n m
q