Skip to content

Commit

Permalink
SCP-5126 Added note on invariants in unpack and repacking AssocMap.
Browse files Browse the repository at this point in the history
  • Loading branch information
bwbush committed Mar 1, 2023
1 parent c288060 commit e227767
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion marlowe/src/Language/Marlowe/Core/V1/Semantics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,9 @@ refundOne accounts = case Map.toList accounts of
-- SCP-5126: The return value of this function differs from
-- Isabelle semantics in that it returns the least-recently
-- added account-token combination rather than the first
-- lexicographically ordered one.
-- lexicographically ordered one. Also, the sequence
-- `Map.fromList . tail . Map.toList` preserves the
-- invariants of order and non-duplication.
((accId, token), balance) : rest ->
if balance > 0
then Just ((accId, token, balance), Map.fromList rest)
Expand Down

0 comments on commit e227767

Please sign in to comment.