X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FbasicTypes%2FNewDemand.lhs;h=e97a7db03b14fbb2249e596b616e9ffd8fcea98c;hb=21eea25f1212ec306aac806233a2ec048212d529;hp=f69d2a457b27f8203628b8c32a644866cf772431;hpb=be5c095aa51d360f4257b6eae1ebe23a7992a7c9;p=ghc-hetmet.git diff --git a/compiler/basicTypes/NewDemand.lhs b/compiler/basicTypes/NewDemand.lhs index f69d2a4..e97a7db 100644 --- a/compiler/basicTypes/NewDemand.lhs +++ b/compiler/basicTypes/NewDemand.lhs @@ -19,12 +19,10 @@ module NewDemand( StrictSig(..), mkStrictSig, topSig, botSig, cprSig, isTopSig, - splitStrictSig, + splitStrictSig, increaseStrictSigArity, pprIfaceStrictSig, appIsBottom, isBottomingSig, seqStrictSig, ) where --- XXX This define is a bit of a hack, and should be done more nicely -#define FAST_STRING_NOT_NEEDED 1 #include "HsVersions.h" import StaticFlags @@ -309,6 +307,11 @@ mkStrictSig dmd_ty = StrictSig dmd_ty splitStrictSig :: StrictSig -> ([Demand], DmdResult) splitStrictSig (StrictSig (DmdType _ dmds res)) = (dmds, res) +increaseStrictSigArity :: Int -> StrictSig -> StrictSig +-- Add extra arguments to a strictness signature +increaseStrictSigArity arity_increase (StrictSig (DmdType env dmds res)) + = StrictSig (DmdType env (replicate arity_increase topDmd ++ dmds) res) + isTopSig :: StrictSig -> Bool isTopSig (StrictSig ty) = isTopDmdType ty