Skip to content

Commit

Permalink
A handler to make everyone happy
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejbauer committed Feb 3, 2016
1 parent 67e1f95 commit 28b005c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions std/hippy.m31
@@ -0,0 +1,27 @@
operation hippy 0

let rec prodify xs t =
match xs with
| [] => t
| (|- ?x : ?u) :: ?xs =>
let t' = forall y : u, (t where x = y) in
prodify xs t'
end

let rec apply head es =
match es with
| [] => head
| ?e :: ?es => apply (head e) es
end

handle
hippy : t =>
match t with
| None => Type
| Some ?t =>
let xs = context in
let t_abs = prodify xs t in
assume hippy : t_abs in
apply hippy (rev xs)
end
end

0 comments on commit 28b005c

Please sign in to comment.