dreixel / syb

Scrap Your Boilerplate generic programming library in Haskell
http://www.cs.uu.nl/wiki/GenericProgramming/SYB
Other
44 stars 23 forks source link

Fix precision issues in tests #29

Closed Bodigrim closed 3 years ago

Bodigrim commented 3 years ago

As it was reported in #20 and #21, the test suite fails in GHCJS. The reason is that the test suite uses Float, but GHCJS emulates them with Double, because underlying JavaScript does not have any single-precision numbers. This leads to mismatches, because

> 100 * 1.1 == (110 :: Float)
True
> 100 * 1.1 == (110 :: Double)
False

There are three commits: