diff options
author | Josh Chen | 2019-02-10 03:17:12 +0100 |
---|---|---|
committer | Josh Chen | 2019-02-10 03:17:12 +0100 |
commit | 923cfeea84cdc4292d38925e2cf6aaf07301db9c (patch) | |
tree | 3934ee1005146ef4f749fdf3538f33374968718e | |
parent | 29068d381a8b5d95c7fd4dc6111dcfb3a181f0bd (diff) |
Fix antiquotation situation
Diffstat (limited to '')
-rw-r--r-- | Prod.thy | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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 |