+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 _ -> getOccString tycon
+ SynTy tycon _ _ -> getOccString tycon
+ DictTy _ _ _ -> "dict"
+ ForAllTy _ ty -> getTyDescription ty
+ _ -> pprPanic "getTyDescription: other" (pprType PprDebug tau_ty)
+ }
+ where
+ fun_result (FunTy _ res _) = '>' : fun_result res
+ fun_result other = getTyDescription other
+\end{code}
+