diff --git a/haskell/lvish/Data/LVar/CtrieMap.hs b/haskell/lvish/Data/LVar/CtrieMap.hs index e7e51311..1a91c086 100644 --- a/haskell/lvish/Data/LVar/CtrieMap.hs +++ b/haskell/lvish/Data/LVar/CtrieMap.hs @@ -240,7 +240,8 @@ insert !key !elm (IMap (WrapLVar lv)) = WrapPar$ putLV lv putter where putter cm = do putRes <- CM.putIfAbsent cm key $ return elm case putRes of - CM.Added _ -> return $ Just (key, elm) + CM.Added _ -> return $ Just (key, elm) + CM.Found v | elm == v -> return $ Just (key, elm) CM.Found _ -> throw$ ConflictingPutExn$ "Multiple puts to one entry in an IMap!" -- | `IMap`s containing other LVars have some additional capabilities compared to diff --git a/haskell/lvish/Data/LVar/SLMap.hs b/haskell/lvish/Data/LVar/SLMap.hs index 102607cb..006f163d 100644 --- a/haskell/lvish/Data/LVar/SLMap.hs +++ b/haskell/lvish/Data/LVar/SLMap.hs @@ -235,7 +235,8 @@ insert !key !elm (IMap (WrapLVar lv)) = WrapPar$ putLV lv putter where putter slm = do putRes <- SLM.putIfAbsent slm key $ return elm case putRes of - Added _ -> return $ Just (key, elm) + Added _ -> return $ Just (key, elm) + Found v | elm == v -> return $ Just (key, elm) Found _ -> throw$ ConflictingPutExn$ "Multiple puts to one entry in an IMap!" -- | `IMap`s containing other LVars have some additional capabilities compared to