Skip to content

Commit

Permalink
quasar: Fix bug in ObservableList to ObservableSet conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
thelegy committed Jun 27, 2024
1 parent 67367de commit 5ad4111
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion quasar/src/Quasar/Observable/Set.hs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,10 @@ instance Ord v => IsObservableCore canLoad exceptions Set v (ObservableListToSet
convertOperation _l (ObservableList.ListAppend value) = Map.insert value Insert
convertOperation l (ObservableList.ListDelete index) = case Seq.lookup (fromIntegral index) l of
Nothing -> id -- illegal delta
Just value -> Map.insert value Delete
Just value ->
if value `elem` Seq.deleteAt (fromIntegral index) l
then id -- still elements with same value in the list
else Map.insert value Delete


fromObservableList :: (ObservableList.ToObservableList l e v s, Ord v) => s -> ObservableSet l e v
Expand Down

0 comments on commit 5ad4111

Please sign in to comment.