on develop help sign in
Merge pull request #16 from reflex-frp/no-fromJust
33987bdJohn Ericson
src/Data/Patch/MapWithMove.hs+3−1
@@ -202,7 +202,9 @@ patchThatChangesMap oldByIndex newByIndex = patch
202 putRemainingKeys $ Set.delete k fromKs
202 putRemainingKeys $ Set.delete k fromKs
203 return $ NodeInfo (From_Move k) $ Just undefined -- There's an existing value, and it's here, so no patch necessary
203 return $ NodeInfo (From_Move k) $ Just undefined -- There's an existing value, and it's here, so no patch necessary
204 else do
204 else do
205+ (fromK, remainingKeys) <- return $
206+ fromMaybe (error "PatchMapWithMove.patchThatChangesMap: impossible: fromKs was empty") $
205− (fromK, remainingKeys) <- return . fromMaybe (error "patchThatChangesMap: impossible: fromKs was empty") $ Set.minView fromKs -- There's an existing value, but it's not here; move it here
207+ Set.minView fromKs -- There's an existing value, but it's not here; move it here
206 putRemainingKeys remainingKeys
208 putRemainingKeys remainingKeys
207 return $ NodeInfo (From_Move fromK) $ Just undefined
209 return $ NodeInfo (From_Move fromK) $ Just undefined
208 Map.traverseWithKey f newByIndex
210 Map.traverseWithKey f newByIndex
src/Data/Patch/MapWithPatchingMove.hs+3−1
@@ -268,7 +268,9 @@ patchThatChangesMap oldByIndex newByIndex = patch
268 putRemainingKeys $ Set.delete k fromKs
268 putRemainingKeys $ Set.delete k fromKs
269 return $ NodeInfo (From_Move k mempty) $ Just undefined -- There's an existing value, and it's here, so no patch necessary
269 return $ NodeInfo (From_Move k mempty) $ Just undefined -- There's an existing value, and it's here, so no patch necessary
270 else do
270 else do
271+ (fromK, remainingKeys) <- return $
272+ fromMaybe (error "PatchMapWithPatchingMove.patchThatChangesMap: impossible: fromKs was empty") $
271− (fromK, remainingKeys) <- return . fromJust $ Set.minView fromKs -- There's an existing value, but it's not here; move it here
273+ Set.minView fromKs -- There's an existing value, but it's not here; move it here
272 putRemainingKeys remainingKeys
274 putRemainingKeys remainingKeys
273 return $ NodeInfo (From_Move fromK mempty) $ Just undefined
275 return $ NodeInfo (From_Move fromK mempty) $ Just undefined
274 Map.traverseWithKey f newByIndex
276 Map.traverseWithKey f newByIndex