diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2011-08-03 16:14:26 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2011-08-03 16:14:26 +0100 |
commit | 1bcd32b8e0f252d3b830c961184dab9d8b61dba9 (patch) | |
tree | 0d6315c9e1a06c4801d89be85c21fa95df97b34e /compiler/codeGen | |
parent | c679ce14814a044d6607b31b8e65e9c7ea17af81 (diff) | |
download | haskell-1bcd32b8e0f252d3b830c961184dab9d8b61dba9.tar.gz |
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
Diffstat (limited to 'compiler/codeGen')
-rw-r--r-- | compiler/codeGen/ClosureInfo.lhs | 6 | ||||
-rw-r--r-- | compiler/codeGen/StgCmmClosure.hs | 6 |
2 files changed, 6 insertions, 6 deletions
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 |