From 95ad0bdf18b31cdb97e68c06ceafc5f8ac5b2ebf Mon Sep 17 00:00:00 2001 From: Eric Brisco Date: Sat, 24 Mar 2018 16:04:03 -0400 Subject: [PATCH] ADD: Bounded Number instance. --- src/Data/Bounded.js | 3 +++ src/Data/Bounded.purs | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/Data/Bounded.js b/src/Data/Bounded.js index 000ec1a7..246f8ac8 100644 --- a/src/Data/Bounded.js +++ b/src/Data/Bounded.js @@ -5,3 +5,6 @@ exports.bottomInt = -2147483648; exports.topChar = String.fromCharCode(65535); exports.bottomChar = String.fromCharCode(0); + +exports.topNumber = Number.POSITIVE_INFINITY; +exports.bottomNumber = Number.NEGATIVE_INFINITY; diff --git a/src/Data/Bounded.purs b/src/Data/Bounded.purs index 36959da6..079c0d72 100644 --- a/src/Data/Bounded.purs +++ b/src/Data/Bounded.purs @@ -44,3 +44,10 @@ instance boundedOrdering :: Bounded Ordering where instance boundedUnit :: Bounded Unit where top = unit bottom = unit + +foreign import topNumber :: Number +foreign import bottomNumber :: Number + +instance boundedNumber :: Bounded Number where + top = topNumber + bottom = bottomNumber