Skip to content

Commit e903fd2

Browse files
chexxorgaryb
authored andcommitted
Explain the magic numbers for Bounded Int. (#172)
* Explain the magic numbers for Bounder Int. * Remove docs, move to PS in next commit. * Add docs for Bounded Int values * Formatting
1 parent 3cbf8d3 commit e903fd2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Data/Bounded.purs

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ instance boundedBoolean :: Bounded Boolean where
2222
top = true
2323
bottom = false
2424

25+
-- | The `Bounded` `Int` instance has `top :: Int` equal to 2^31 - 1,
26+
-- | and `bottom :: Int` equal to -2^31, since these are the largest and smallest
27+
-- | integers representable by twos-complement 32-bit integers, respectively.
2528
instance boundedInt :: Bounded Int where
2629
top = topInt
2730
bottom = bottomInt

0 commit comments

Comments
 (0)