Skip to content

Commit 5b8da18

Browse files
committed
Merge pull request #42 from andyarvanitis/ffi_int_bounds
#1251: move Int bounds to FFI
2 parents df955e0 + b84140d commit 5b8da18

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Prelude.js

+3
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ exports.unsafeCompareImpl = function (lt) {
174174

175175
//- Bounded --------------------------------------------------------------------
176176

177+
exports.topInt = 2147483647;
178+
exports.bottomInt = -2147483648;
179+
177180
exports.topChar = String.fromCharCode(65535);
178181
exports.bottomChar = String.fromCharCode(0);
179182

src/Prelude.purs

+5-2
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,8 @@ instance boundedOrdering :: Bounded Ordering where
734734
bottom = LT
735735

736736
instance boundedInt :: Bounded Int where
737-
top = 2147483647
738-
bottom = -2147483648
737+
top = topInt
738+
bottom = bottomInt
739739

740740
-- | Characters fall within the Unicode range.
741741
instance boundedChar :: Bounded Char where
@@ -746,6 +746,9 @@ instance boundedFn :: (Bounded b) => Bounded (a -> b) where
746746
top _ = top
747747
bottom _ = bottom
748748

749+
foreign import topInt :: Int
750+
foreign import bottomInt :: Int
751+
749752
foreign import topChar :: Char
750753
foreign import bottomChar :: Char
751754

0 commit comments

Comments
 (0)