Skip to content

Commit

Permalink
Explain the magic numbers for Bounded Int. (#172)
Browse files Browse the repository at this point in the history
* Explain the magic numbers for Bounder Int.

* Remove docs, move to PS in next commit.

* Add docs for Bounded Int values

* Formatting
  • Loading branch information
chexxor authored and garyb committed May 13, 2018
1 parent 3cbf8d3 commit e903fd2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Data/Bounded.purs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ instance boundedBoolean :: Bounded Boolean where
top = true
bottom = false

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

0 comments on commit e903fd2

Please sign in to comment.