1. 5

Yeah it was pretty weird.


  2. [Comment removed by author]

    1. 3

      Slightly incorrect–Javascript numbers are double-precision (64-bit) floats (see old writeup here).

      If you need 32-bit floats (say, for WebGL interop), you use typed arrays.

      1. 2

        Does haskell have an algebraic type?

        1. 1

          Not in the standard library. That sort of representation is hard to implement. In a quick search of Hackage I turned up some algebra packages, but they don’t appear to come with implementations of Num or be intended for that kind of use. Performance would be bad, also…

        2. 1

          You should and people typical do expect arithmetic to work correctly for integer values and integer results in Javascript.