Created
May 18, 2018 18:53
-
-
Save andrewthad/8536c07c9b0ac00e2f7ce9f9e2094fc4 to your computer and use it in GitHub Desktop.
Diet Set GADT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Nat = Z | S Nat | |
data TwoGt :: Nat -> Nat -> Type | |
TwoGtNil :: Gt ('S ('S n)) 'Z | |
TwoGtStep :: Gt n m -> Gt (S n) (S m) | |
data Diet :: Nat -> Type where | |
DietNil :: Diet 'Z | |
DietCons :: forall n m. Gte n m -> TwoGt m p -> Diet p -> Diet n | |
data DietX = forall n. DietX (Diet n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment