summaryrefslogtreecommitdiff
path: root/src/Storage/List.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2022-05-17 22:06:01 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2022-05-17 22:06:01 +0200
commitb8e55c64a68763b0953945476cc75206f5354023 (patch)
tree741f7e66faace0be22ecaa6346f2ca79c045893b /src/Storage/List.hs
parentb9e50633254a8c45159a6088309969872b8aae50 (diff)
Mergeable class with separate component type
Diffstat (limited to 'src/Storage/List.hs')
-rw-r--r--src/Storage/List.hs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/Storage/List.hs b/src/Storage/List.hs
index e112b46..2bef401 100644
--- a/src/Storage/List.hs
+++ b/src/Storage/List.hs
@@ -44,9 +44,6 @@ instance Storable a => Storable (List a) where
instance Storable a => ZeroStorable (List a) where
fromZero _ = ListNil
-instance Storable a => Mergeable (List a) where
- mergeSorted xs = ListItem xs Nothing Nothing
-
emptySList :: Storable a => Storage -> IO (StoredList a)
emptySList st = wrappedStore st ListNil
@@ -78,10 +75,10 @@ groupsFromSLists = helperSelect S.empty . (:[])
filterRemoved :: S.Set (StoredList a) -> [StoredList a] -> [StoredList a]
filterRemoved rs = filter (S.null . S.intersection rs . ancestors . (:[]))
-fromSList :: Mergeable a => StoredList a -> [a]
+fromSList :: Mergeable a => StoredList (Component a) -> [a]
fromSList = map merge . groupsFromSLists
-storedFromSList :: Mergeable a => StoredList a -> IO [Stored a]
+storedFromSList :: (Mergeable a, Storable a) => StoredList (Component a) -> IO [Stored a]
storedFromSList = mapM storeMerge . groupsFromSLists
slistAdd :: Storable a => a -> StoredList a -> IO (StoredList a)