From 1bcd32b8e0f252d3b830c961184dab9d8b61dba9 Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Wed, 3 Aug 2011 16:14:26 +0100 Subject: Add Type.tyConAppTyCon_maybe and tyConAppArgs_maybe, and use them These turn out to be a useful special case of splitTyConApp_maybe. A refactoring only; no change in behaviour --- compiler/codeGen/ClosureInfo.lhs | 6 +++--- compiler/codeGen/StgCmmClosure.hs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'compiler/codeGen') diff --git a/compiler/codeGen/ClosureInfo.lhs b/compiler/codeGen/ClosureInfo.lhs index 60f1bda7f5..8bfbfed0bc 100644 --- a/compiler/codeGen/ClosureInfo.lhs +++ b/compiler/codeGen/ClosureInfo.lhs @@ -268,9 +268,9 @@ might_be_a_function :: Type -> Bool -- Return False only if we are *sure* it's a data type -- Look through newtypes etc as much as poss might_be_a_function ty - = case splitTyConApp_maybe (repType ty) of - Just (tc, _) -> not (isDataTyCon tc) - Nothing -> True + = case tyConAppTyCon_maybe (repType ty) of + Just tc -> not (isDataTyCon tc) + Nothing -> True \end{code} @mkConLFInfo@ is similar, for constructors. diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs index 2492bafc6c..daaf021f03 100644 --- a/compiler/codeGen/StgCmmClosure.hs +++ b/compiler/codeGen/StgCmmClosure.hs @@ -255,9 +255,9 @@ might_be_a_function :: Type -> Bool -- Return False only if we are *sure* it's a data type -- Look through newtypes etc as much as poss might_be_a_function ty - = case splitTyConApp_maybe (repType ty) of - Just (tc, _) -> not (isDataTyCon tc) - Nothing -> True + = case tyConAppTyCon_maybe (repType ty) of + Just tc -> not (isDataTyCon tc) + Nothing -> True ------------- mkConLFInfo :: DataCon -> LambdaFormInfo -- cgit v1.2.1