Compiling the following source generates a syntax-error in JavaScript.
{-# INLINE f #-}
f :: Double
f = -1
x :: Double
x = read "1"
main :: IO ()
main = print $ 1 - f * x
The generated code contains var _kz=jsShow(1--1*E(_ky.a)); , which looks directly inlining the value f and resulting in an error in the expression 1--1*E(...).
JS tells Uncaught ReferenceError: Invalid left-hand side expression in postfix operation, and Uncaught SyntaxError: Unexpected number in different case (seems to be the same cause.)
Note: the actual case is writing fromIntegral (floor e), which internally calls INLINEd function GHC.Float.RealFracMethods.floorDoubleInteger.
I'm using x86_64-windows-haste-0.5.5.1-ghc-7.10.2.
Compiling the following source generates a syntax-error in JavaScript.
The generated code contains
var _kz=jsShow(1--1*E(_ky.a));
, which looks directly inlining the valuef
and resulting in an error in the expression1--1*E(...)
. JS tellsUncaught ReferenceError: Invalid left-hand side expression in postfix operation
, andUncaught SyntaxError: Unexpected number
in different case (seems to be the same cause.)Note: the actual case is writing
fromIntegral (floor e)
, which internally calls INLINEd functionGHC.Float.RealFracMethods.floorDoubleInteger
.I'm using x86_64-windows-haste-0.5.5.1-ghc-7.10.2.