Skip to content

Commit 2491d82

Browse files
committed
Allow IOG's contra-tracer
1 parent 54a958f commit 2491d82

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lsm-tree.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ library
613613
, bytestring ^>=0.11.4.0 || ^>=0.12.1.0
614614
, cborg ^>=0.2.10.0
615615
, containers ^>=0.6 || ^>=0.7
616-
, contra-tracer ^>=0.2
616+
, contra-tracer ^>=0.1 || ^>=0.2
617617
, crc32c ^>=0.2.1
618618
, deepseq ^>=1.4 || ^>=1.5
619619
, filepath

src/Database/LSMTree/Internal/Unsafe.hs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,19 @@ data TableTrace =
202202
| TraceSupplyUnionCredits UnionCredits
203203
deriving stock Show
204204

205-
contramapTraceMerge :: Monad m => Tracer m TableTrace -> Tracer m (AtLevel MergeTrace)
205+
contramapTraceMerge :: forall m. Monad m => Tracer m TableTrace -> Tracer m (AtLevel MergeTrace)
206+
#if MIN_VERSION_contra_tracer(0,2,0)
206207
#ifdef DEBUG_TRACES
207208
contramapTraceMerge t = TraceMerge `contramap` t
208209
#else
209210
contramapTraceMerge t = traceMaybe (const Nothing) t
210211
#endif
212+
#else
213+
contramapTraceMerge _t = nullTracer
214+
where
215+
-- See #766
216+
_unused = pure @m ()
217+
#endif
211218

212219
data CursorTrace =
213220
TraceCreateCursor TableId

0 commit comments

Comments
 (0)