Skip to content

Commit

Permalink
fix split for integer
Browse files Browse the repository at this point in the history
  • Loading branch information
polinavino committed Aug 11, 2020
1 parent 52c14af commit 5961887
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -62,6 +62,7 @@ instance Val Integer where
vcoin x = Coin x
vinject (Coin x) = x
vsize _ = 1
vsplit n 0 = (Coin 0, n)
vsplit n m
| m <= 0 = error "must split coins into positive parts"
| otherwise = (n `div` m, Coin $ n `rem` m)
Expand Down

0 comments on commit 5961887

Please sign in to comment.