Skip to content

Commit e8011d7

Browse files
committed
Stop using forbidden fromJust
1 parent 5335f5d commit e8011d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Data/Patch/MapWithMove.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ patchThatChangesMap oldByIndex newByIndex = patch
199199
putRemainingKeys $ Set.delete k fromKs
200200
return $ NodeInfo (From_Move k) $ Just undefined -- There's an existing value, and it's here, so no patch necessary
201201
else do
202-
(fromK, remainingKeys) <- return . fromJust $ Set.minView fromKs -- There's an existing value, but it's not here; move it here
202+
(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
203203
putRemainingKeys remainingKeys
204204
return $ NodeInfo (From_Move fromK) $ Just undefined
205205
Map.traverseWithKey f newByIndex

0 commit comments

Comments
 (0)