convertHypothesis :: Binding -> HypBinding
convertHypothesis b@(mn, _, a@(A _ (P name _))) =
  HypBinding mn (isImplicit b) $
     case name of
       "term"    -> TermTy (convertOpen convertTermType a)
       "prop"    -> PropTy (convertOpen convertPropType a)
       "proof"   -> ProofTy (convertOpen convertProofType a)
       "ref"     -> RefTy (convertOpen convertRefType a)
       "sequent" -> SequentTy (convertOpen convertSequentConst a)
       _         -> error $ concat ["Hypothetical object '"
                                   , show mn, "' has unknown type: ", show a]
convertHypothesis :: Binding -> HypBinding
convertHypothesis b@(mn, _, a@(A _ (P name _))) =
  HypBinding mn (isImplicit b) $
     case name of
       "term"    -> TermTy (convertOpen convertTermType a)
       "prop"    -> PropTy (convertOpen convertPropType a)
       "proof"   -> ProofTy (convertOpen convertProofType a)
       "ref"     -> RefTy (convertOpen convertRefType a)
       "sequent" -> SequentTy (convertOpen convertSequentConst a)
       _         -> error $ concat ["Hypothetical object '"
                                   , show mn, "' has unknown type: ", show a]
convertHypothesis b@(mn, _, a@(A _ (P name _))) =
  HypBinding mn (isImplicit b) $
     case name of
       "term"    -> TermTy (convertOpen convertTermType a)
       "prop"    -> PropTy (convertOpen convertPropType a)
       "proof"   -> ProofTy (convertOpen convertProofType a)
       "ref"     -> RefTy (convertOpen convertRefType a)
       "sequent" -> SequentTy (convertOpen convertSequentConst a)
       _         -> error $ concat ["Hypothetical object '"
                                   , show mn, "' has unknown type: ", show a]