[Haskell-cafe] Haskell Cheat Sheet

Evan Laforge qdunkan at gmail.com
Tue Mar 4 21:33:51 UTC 2014


Indeed on both OS X and 64 bit linux:

Prelude> logBase 2 (fromIntegral (maxBound :: Int))
63.0

On a bit of a tangent, I always assumed that the 30bit Int range was
intended for some pointer-tagging hack, and that maybe ocaml did
something like that?  But in practice GHC always had full 32 or 64
bits.  Do other haskell compilers stash something in the Int high bit?

On Tue, Mar 4, 2014 at 1:19 PM, Karl Voelker <karl at karlv.net> wrote:
> I'm not in a position to make a PR right now, but I did notice that you
> describe Int as 32 bits, which is not necessarily true. From the Haskell
> 2010 Report section 6.4:
>
> "The finite-precision integer type Int covers at least the range [  −  229,
> 229  −  1]. As Int is an instance of the Bounded class, maxBound and
> minBound can be used to determine the exact Int range defined by an
> implementation."
>
> -Karl
>
> On Mar 4, 2014, at 3:12 AM, Rudy Matela <rudy at matela.com.br> wrote:
>
> Hello, All,
>
> Some time ago, I was looking for a Haskell Cheat Sheet, to help me
> remember Haskell's syntax and common functions.  I've found one, but
> it was quite long (14 pages), not what I was looking for.
>
> So, I've started building a Haskell Cheat Sheet with the most common
> language features condensed in two pages.  It still needs a lot of
> improvement (and some content).  I'm using LaTeX and I've built a
> "cls" (so it can be used to create Sheets for other languages as
> well), it is kind of a hack for now.
>
> If someone wants to use it as a reference, the first version can be
> found on [1] and the TeX source can be found on GitHub [2].
>
> I would appreciate help on it: feel free to fork and make pull
> requests with new additions (or mail me asking for push permissions).
>
> Regards,
> Rudy
>
> [1]: https://matela.com.br/pub/cheat-sheets/haskell-ucs-0.1.pdf
> [2]: https://github.com/rudymatela/ultimate-cheat-sheets
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list