aboutsummaryrefslogtreecommitdiff
path: root/Prod.thy
diff options
context:
space:
mode:
authorJosh Chen2019-02-10 03:17:12 +0100
committerJosh Chen2019-02-10 03:17:12 +0100
commit923cfeea84cdc4292d38925e2cf6aaf07301db9c (patch)
tree3934ee1005146ef4f749fdf3538f33374968718e /Prod.thy
parent29068d381a8b5d95c7fd4dc6111dcfb3a181f0bd (diff)
Fix antiquotation situation
Diffstat (limited to 'Prod.thy')
-rw-r--r--Prod.thy13
1 files changed, 8 insertions, 5 deletions
diff --git a/Prod.thy b/Prod.thy
index ce785d6..ed03be5 100644
--- a/Prod.thy
+++ b/Prod.thy
@@ -79,15 +79,18 @@ syntax "_compose" :: "[t, t] \<Rightarrow> t" (infixr "o" 110)
parse_translation \<open>
let fun compose_tr ctxt [g, f] =
let
- val [g, f] = [g, f] |> map (Typing.prep_term @{context})
+ val [g, f] = [g, f] |> map (Typing.prep_term ctxt)
val dom =
case f of
Const ("Prod.lam", _) $ T $ _ => T
| Const ("Prod.compose", _) $ T $ _ $ _ => T
- | _ => (case Typing.get_typing ctxt f of
- SOME (Const ("Prod.Prod", _) $ T $ _) => T
- | SOME t => (@{print} t; Exn.error "Can't compose with a non-function")
- | NONE => Exn.error "Cannot infer domain of composition; please state this explicitly")
+ | _ =>
+ case Typing.get_typing ctxt f of
+ SOME (Const ("Prod.Prod", _) $ T $ _) => T
+ | SOME t =>
+ Exn.error ("Can't compose with a non-function " ^ Syntax.string_of_term ctxt f)
+ | NONE =>
+ Exn.error "Cannot infer domain of composition; please state this explicitly"
in
@{const compose} $ dom $ g $ f
end