+Grab a name for the type. This is used to determine the type
+description for profiling.
+\begin{code}
+getTyDescription :: Type -> String
+
+getTyDescription ty
+ = case (splitSigmaTy ty) of { (_, _, tau_ty) ->
+ case tau_ty of
+ TyVarTy _ -> "*"
+ AppTy fun _ -> getTyDescription fun
+ FunTy _ res _ -> '-' : '>' : fun_result res
+ TyConTy tycon _ -> _UNPK_ (getLocalName tycon)
+ SynTy tycon _ _ -> _UNPK_ (getLocalName tycon)
+ DictTy _ _ _ -> "dict"
+ _ -> pprPanic "getTyDescription: other" (pprType PprDebug tau_ty)
+ }
+ where
+ fun_result (FunTy _ res _) = '>' : fun_result res
+ fun_result other = getTyDescription other
+\end{code}
+