Skip to content

#1251: move Int bounds to FFI #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Prelude.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ exports.unsafeCompareImpl = function (lt) {

//- Bounded --------------------------------------------------------------------

exports.topInt = 2147483647;
exports.bottomInt = -2147483648;

exports.topChar = String.fromCharCode(65535);
exports.bottomChar = String.fromCharCode(0);

Expand Down
7 changes: 5 additions & 2 deletions src/Prelude.purs
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,8 @@ instance boundedOrdering :: Bounded Ordering where
bottom = LT

instance boundedInt :: Bounded Int where
top = 2147483647
bottom = -2147483648
top = topInt
bottom = bottomInt

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

foreign import topInt :: Int
foreign import bottomInt :: Int

foreign import topChar :: Char
foreign import bottomChar :: Char

Expand Down