Skip to content

Commit

Permalink
Simplify implementation of TokenBundle.add.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Jun 6, 2023
1 parent b8c5890 commit 355a90c
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -327,8 +327,7 @@ setCoin b c = b { coin = c }
-- | Adds one token bundle to another.
--
add :: TokenBundle -> TokenBundle -> TokenBundle
add (TokenBundle (Coin c1) m1) (TokenBundle (Coin c2) m2) =
TokenBundle (Coin $ c1 + c2) (TokenMap.add m1 m2)
add = (<>)

-- | Subtracts the second token bundle from the first.
--
Expand Down

0 comments on commit 355a90c

Please sign in to comment.