Skip to content

Commit da7e33f

Browse files
committed
Remove redundant constraints in the public API
1 parent 53cd2b7 commit da7e33f

File tree

2 files changed

+6
-34
lines changed

2 files changed

+6
-34
lines changed

src/Database/LSMTree/Monoidal.hs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
{-# LANGUAGE OverloadedStrings #-}
2-
3-
-- TODO: remove once the API is implemented.
4-
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
5-
61
-- | On disk key-value tables, implemented as Log Structured Merge (LSM) trees.
72
--
83
-- This module is the API for \"monoidal\" tables, as opposed to \"normal\"
@@ -522,7 +517,7 @@ mupserts t = updates t . fmap (second Mupsert)
522517
-------------------------------------------------------------------------------}
523518

524519
{-# SPECIALISE createSnapshot ::
525-
(SerialiseKey k, SerialiseValue v, ResolveValue v, Common.Labellable (k, v))
520+
(ResolveValue v, Common.Labellable (k, v))
526521
=> SnapshotName
527522
-> Table IO k v
528523
-> IO () #-}
@@ -550,8 +545,6 @@ mupserts t = updates t . fmap (second Mupsert)
550545
--
551546
createSnapshot :: forall m k v.
552547
( IOLike m
553-
, SerialiseKey k
554-
, SerialiseValue v
555548
, ResolveValue v
556549
, Common.Labellable (k, v)
557550
)
@@ -564,7 +557,7 @@ createSnapshot snap (Internal.MonoidalTable t) =
564557
label = Internal.SnapshotLabel $ Common.makeSnapshotLabel (Proxy @(k, v))
565558

566559
{-# SPECIALISE openSnapshot ::
567-
(SerialiseKey k, SerialiseValue v, ResolveValue v, Common.Labellable (k, v))
560+
(ResolveValue v, Common.Labellable (k, v))
568561
=> Session IO
569562
-> Common.TableConfigOverride
570563
-> SnapshotName
@@ -589,8 +582,6 @@ createSnapshot snap (Internal.MonoidalTable t) =
589582
-- @
590583
openSnapshot :: forall m k v.
591584
( IOLike m
592-
, SerialiseKey k
593-
, SerialiseValue v
594585
, ResolveValue v
595586
, Common.Labellable (k, v)
596587
)
@@ -681,7 +672,7 @@ union :: forall m k v.
681672
=> Table m k v
682673
-> Table m k v
683674
-> m (Table m k v)
684-
union = undefined
675+
union = error "union: not yet implemented" $ union @m @k @v
685676

686677
{-------------------------------------------------------------------------------
687678
Monoidal value resolution

src/Database/LSMTree/Normal.hs

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
{-# LANGUAGE OverloadedStrings #-}
2-
3-
-- TODO: remove once the API is implemented.
4-
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
5-
61
-- | On disk key-value tables, implemented as Log Structured Merge (LSM) trees.
72
--
83
-- This module is the API for \"normal\" tables, as opposed to \"monoidal\"
@@ -640,11 +635,7 @@ retrieveBlobs (Internal.Session' (sesh :: Internal.Session m h)) refs =
640635
-------------------------------------------------------------------------------}
641636

642637
{-# SPECIALISE createSnapshot ::
643-
( SerialiseKey k
644-
, SerialiseValue v
645-
, SerialiseValue blob
646-
, Common.Labellable (k, v, blob)
647-
)
638+
Common.Labellable (k, v, blob)
648639
=> SnapshotName
649640
-> Table IO k v blob
650641
-> IO () #-}
@@ -679,9 +670,6 @@ retrieveBlobs (Internal.Session' (sesh :: Internal.Session m h)) refs =
679670
-- but the original table remains unchanged.
680671
createSnapshot :: forall m k v blob.
681672
( IOLike m
682-
, SerialiseKey k
683-
, SerialiseValue v
684-
, SerialiseValue blob
685673
, Common.Labellable (k, v, blob)
686674
)
687675
=> SnapshotName
@@ -693,11 +681,7 @@ createSnapshot snap (Internal.NormalTable t) =
693681
label = Internal.SnapshotLabel $ Common.makeSnapshotLabel (Proxy @(k, v, blob))
694682

695683
{-# SPECIALISE openSnapshot ::
696-
( SerialiseKey k
697-
, SerialiseValue v
698-
, SerialiseValue blob
699-
, Common.Labellable (k, v, blob)
700-
)
684+
Common.Labellable (k, v, blob)
701685
=> Session IO
702686
-> Common.TableConfigOverride
703687
-> SnapshotName
@@ -725,9 +709,6 @@ createSnapshot snap (Internal.NormalTable t) =
725709
-- proper snapshots. See 'createSnapshot'.
726710
openSnapshot :: forall m k v blob.
727711
( IOLike m
728-
, SerialiseKey k
729-
, SerialiseValue v
730-
, SerialiseValue blob
731712
, Common.Labellable (k, v, blob)
732713
)
733714
=> Session m
@@ -813,4 +794,4 @@ union :: forall m k v blob.
813794
=> Table m k v blob
814795
-> Table m k v blob
815796
-> m (Table m k v blob)
816-
union = undefined
797+
union = error "union: not yet implemented" $ union @m @k @v

0 commit comments

Comments
 (0)