Skip to content

Commit a9ce0c1

Browse files
committed
FBCM-5115 Add an Ord instance for Cents
This instance allows us not only to compare `Cents` values but also to use them in a `Set`, which requires an `Ord` instance.
1 parent d47a840 commit a9ce0c1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Data/Currency.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import Prim.TypeError (class Warn, Text)
2727
newtype Cents = Cents BigInt
2828
derive instance newtypeCents :: Newtype Cents _
2929
derive newtype instance eqCents :: Eq Cents
30+
derive newtype instance ordCents :: Ord Cents
3031

3132
instance encodeJsonCents :: EncodeJson Cents where
3233
encodeJson = encodeJson <<< centsToNumber

0 commit comments

Comments
 (0)