Commit dbcf03e0 authored by's avatar
Browse files

Utilities for handling closure types during vectorisation

parent e8ebfa82
......@@ -273,3 +273,14 @@ vectType (ForAllTy tv ty)
vectType ty = pprPanic "vectType:" (ppr ty)
isClosureTyCon :: TyCon -> Bool
isClosureTyCon tc = tyConUnique tc == closureTyConKey
splitClosureTy :: Type -> (Type, Type)
splitClosureTy ty
| Just (tc, [arg_ty, res_ty]) <- splitTyConApp_maybe ty
, isClosureTyCon tc
= (arg_ty, res_ty)
| otherwise = pprPanic "splitClosureTy" (ppr ty)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment