Skip to content

Commit

Permalink
Merge pull request #162 from erisco/eric/boundednum
Browse files Browse the repository at this point in the history
ADD: Bounded Number instance.
  • Loading branch information
garyb authored Apr 7, 2018
2 parents da4e752 + 95ad0bd commit aad9768
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Data/Bounded.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
7 changes: 7 additions & 0 deletions src/Data/Bounded.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit aad9768

Please sign in to comment.