Advertisement
tinyevil

Untitled

Mar 7th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. Inductive Existential : Type :=
  2. | witness : forall T:Type, T -> Existential
  3. | nothing.
  4.  
  5. Check Existential.
  6. (* : Type@{max(Set, Top.11+1)}
  7.  
  8. Existential is in type 2 *)
  9.  
  10. Fail Check (witness Existential (witness bool true)).
  11. (* this must live in type 3 to hold a value of type 2 *)
  12.  
  13. (* it needs to be polymrphic for this to work *)
  14. Polymorphic Inductive PolyExistential : Type :=
  15. | poly_witness : forall T:Type, T -> PolyExistential
  16. | poly_nothing.
  17.  
  18. Check (poly_witness PolyExistential (poly_witness bool true)).
  19. (* ^ this is in type(3) ^ this is in type(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement