Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. {-# LANGUAGE DataKinds #-}
  2. {-# LANGUAGE GADTs #-}
  3.  
  4. data Nat = Z | S Nat
  5.  
  6. data Peano n where
  7. Zero :: Peano Z
  8. Succ :: Peano n -> Peano (S n)
  9.  
  10. type family Leq a b where
  11. Leq Z b = 'True
  12. Leq (S a) Z = False
  13. Leq (S a) (S b) = Leq a b
  14.  
  15. type family InRange a b x where
  16. InRange a b x = Leq a x '&& Leq x b
  17.  
  18.  
  19. tall :: (InRange (S (S Z)) (S (S (S (S Z)))) n ~ 'True) => Peano n
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement