Skip to content

Commit aad9768

Browse files
authored
Merge pull request #162 from erisco/eric/boundednum
ADD: Bounded Number instance.
2 parents da4e752 + 95ad0bd commit aad9768

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/Data/Bounded.js

+3
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ exports.bottomInt = -2147483648;
55

66
exports.topChar = String.fromCharCode(65535);
77
exports.bottomChar = String.fromCharCode(0);
8+
9+
exports.topNumber = Number.POSITIVE_INFINITY;
10+
exports.bottomNumber = Number.NEGATIVE_INFINITY;

src/Data/Bounded.purs

+7
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,10 @@ instance boundedOrdering :: Bounded Ordering where
4444
instance boundedUnit :: Bounded Unit where
4545
top = unit
4646
bottom = unit
47+
48+
foreign import topNumber :: Number
49+
foreign import bottomNumber :: Number
50+
51+
instance boundedNumber :: Bounded Number where
52+
top = topNumber
53+
bottom = bottomNumber

0 commit comments

Comments
 (0)