aboutsummaryrefslogtreecommitdiff
path: root/src/Reflection/Syntax.v
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2016-11-15 18:16:05 -0500
committerGravatar Jason Gross <jgross@mit.edu>2016-11-16 14:35:33 -0500
commita0198e0cac509ece542831fe2c62fcab3612b5ca (patch)
tree1dd5b0156fc74bf45ff05cec78c34cb74cb0a5b4 /src/Reflection/Syntax.v
parent31d577c84f2b987ac040565b7a2dd392a58e851a (diff)
Add UnReturn, UnAbs
Diffstat (limited to 'src/Reflection/Syntax.v')
-rw-r--r--src/Reflection/Syntax.v10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Reflection/Syntax.v b/src/Reflection/Syntax.v
index 2f99be49c..b70f939ae 100644
--- a/src/Reflection/Syntax.v
+++ b/src/Reflection/Syntax.v
@@ -195,6 +195,16 @@ Section language.
| Abs {src dst} : (var src -> expr dst) -> expr (Arrow src dst).
Bind Scope expr_scope with expr.
Global Coercion Return : exprf >-> expr.
+ Definition UnReturn {t} (e : expr (Tflat t)) : exprf t
+ := match e with
+ | Return _ v => v
+ | Abs _ _ _ => I
+ end.
+ Definition UnAbs {src dst} (e : expr (Arrow src dst)) : var src -> expr dst
+ := match e with
+ | Return _ _ => I
+ | Abs _ _ f => f
+ end.
(** Sometimes, we want to deal with partially-interpreted
expressions, things like [prod (exprf A) (exprf B)] rather
than [exprf (Prod A B)], or like [prod (var A) (var B)] when