Skip to content

Commit

Permalink
Simplify definition of TokenQuantity.difference.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed May 31, 2023
1 parent 77af251 commit 8fee775
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -55,7 +55,7 @@ import Data.Monoid.Cancellative
import Data.Monoid.GCD
( GCDMonoid, LeftGCDMonoid, RightGCDMonoid )
import Data.Monoid.Monus
( Monus, OverlappingGCDMonoid )
( Monus ((<\>)), OverlappingGCDMonoid )
import Data.Monoid.Null
( MonoidNull )
import Data.Semigroup.Commutative
Expand Down Expand Up @@ -161,7 +161,7 @@ succ = (`add` TokenQuantity 1)
-- Returns 'zero' if the first quantity is less than the second quantity.
--
difference :: TokenQuantity -> TokenQuantity -> TokenQuantity
difference x y = fromMaybe zero $ subtract x y
difference = (<\>)

--------------------------------------------------------------------------------
-- Partitioning
Expand Down

0 comments on commit 8fee775

Please sign in to comment.