+make_tyConApp :: TyCon -> [Type] -> C.Ty
+make_tyConApp tc [t1, t2] | tc == transCoercionTyCon =
+ C.TransCoercion (make_ty t1) (make_ty t2)
+make_tyConApp tc [t] | tc == symCoercionTyCon =
+ C.SymCoercion (make_ty t)
+make_tyConApp tc [t1, t2] | tc == unsafeCoercionTyCon =
+ C.UnsafeCoercion (make_ty t1) (make_ty t2)
+make_tyConApp tc [t] | tc == leftCoercionTyCon =
+ C.LeftCoercion (make_ty t)
+make_tyConApp tc [t] | tc == rightCoercionTyCon =
+ C.RightCoercion (make_ty t)
+make_tyConApp tc [t1, t2] | tc == instCoercionTyCon =
+ C.InstCoercion (make_ty t1) (make_ty t2)
+-- this fails silently if we have an application
+-- of a wired-in coercion tycon to the wrong number of args.
+-- Not great...
+make_tyConApp tc ts =
+ foldl C.Tapp (C.Tcon (qtc tc))
+ (map make_ty ts)