Skip to content

Commit

Permalink
Simplify implementation of TokenBundle.difference.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Jun 2, 2023
1 parent a200e7a commit a09b324
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -95,6 +95,8 @@ import Data.Map.Strict
( Map )
import Data.Monoid.Cancellative
( Reductive ((</>)) )
import Data.Monoid.Monus
( Monus ((<\>)) )
import Data.Ord
( comparing )
import Data.Set
Expand Down Expand Up @@ -309,9 +311,7 @@ subtract (TokenBundle c1 m1) (TokenBundle c2 m2) =
--
difference :: TokenBundle -> TokenBundle -> TokenBundle
difference (TokenBundle c1 m1) (TokenBundle c2 m2) =
TokenBundle
(Coin.difference c1 c2)
(TokenMap.difference m1 m2)
TokenBundle (c1 <\> c2) (m1 <\> m2)

--------------------------------------------------------------------------------
-- Quantities
Expand Down

0 comments on commit a09b324

Please sign in to comment.