News for hackers. Stuff that matters.
Re:GHCJS - Haskell in the Browser by chongli on Wednesday June 26, 2013 @07:01PM (#5949684)
>The GHCJS linker does tree shaking

Ahh, so does this mean we can shake out entire libraries like JSBN if we avoid using Integer?

Re:GHCJS - Haskell in the Browser by luite on Wednesday June 26, 2013 @07:43PM (#5949842)
If you're really careful and not use anything from base that might use an Integer ;)

Currently non-Haskell dependencies are managed per package, so if anything from integer-gmp is linked, it will include the whole JSBN.

If you want to weed out the unused JSBN part, you can use closure compiler (although the new code generator will probably still have a few incompatibilities with it).

Re:GHCJS - Haskell in the Browser by chongli on Wednesday June 26, 2013 @08:41PM (#5950023)
Oh, so does that mean I can't do anything that uses the Integral class, for example? Even if I make sure all my types are Ints?
Re:GHCJS - Haskell in the Browser by luite on Thursday June 27, 2013 @03:06AM (#5951038)
You can use the Integral class (when compiling, the instance gets converted to an extra dictionary argument, if you never use the instance the dictionary will be unreachable)

But Integer is really hard to avoid in general, for example the Show instance for Double depends on it.