checkObject (Fun name t o) context =
  do checkArgType t context
     let t' = reduceTerm t
     ot <- checkObject o (concatTerm context name t')
     case ot of
       (C c) -> return (C (Quant name t' (reduceContext c)))
       (O o) -> return (O (Prod name t' (reduceObject o)))
checkObject (Fun name t o) context =
  do checkArgType t context
     let t' = reduceTerm t
     ot <- checkObject o (concatTerm context name t')
     case ot of
       (C c) -> return (C (Quant name t' (reduceContext c)))
       (O o) -> return (O (Prod name t' (reduceObject o)))
checkObject (Fun name t o) context =
  do checkArgType t context
     let t' = reduceTerm t
     ot <- checkObject o (concatTerm context name t')
     case ot of
       (C c) -> return (C (Quant name t' (reduceContext c)))
       (O o) -> return (O (Prod name t' (reduceObject o)))