@@ -102,7 +102,7 @@ traceTerm shouldGC shouldInline enableSelThunkOpt = go
102
102
data SummarizeOptions = SummarizeOptions {
103
103
summarizeCollapseBeta :: Bool
104
104
, summarizeMaxNumSteps :: Int
105
- , summarizeHidePrelude :: Bool
105
+ , summarizeHidePrelude :: Maybe Int
106
106
, summarizeHideTerms :: [String ]
107
107
, summarizeHideGC :: Bool
108
108
, summarizeHideSelThunk :: Bool
@@ -167,7 +167,7 @@ summarize SummarizeOptions{..} = go 0
167
167
168
168
where
169
169
showSrc :: TraceCont -> Trace
170
- showSrc = Trace (goHeap hp, e)
170
+ showSrc = Trace (goHeap n hp, e)
171
171
172
172
-- | We already saw one beta reduction; skip any subsequent ones
173
173
goBeta :: Int -> Trace -> TraceCont
@@ -186,13 +186,15 @@ summarize SummarizeOptions{..} = go 0
186
186
_otherwise -> False
187
187
188
188
-- | Cleanup the heap
189
- goHeap :: Heap Term -> Heap Term
190
- goHeap (Heap next heap) =
189
+ goHeap :: Int -> Heap Term -> Heap Term
190
+ goHeap n (Heap next heap) =
191
191
Heap next $ Map. filterWithKey shouldShow heap
192
192
where
193
193
shouldShow :: Ptr -> Term -> Bool
194
194
shouldShow (Ptr Nothing (Just name)) _ = and [
195
- not summarizeHidePrelude
195
+ case summarizeHidePrelude of
196
+ Nothing -> True
197
+ Just n' -> n < n'
196
198
, not (name `elem` summarizeHideTerms)
197
199
]
198
200
shouldShow (Ptr _ _) _ = True
0 commit comments