
Nathan Hüsken
I noticed than when using this code:
(-1.0) . isKeyPressed leftKeyCode <|> 0.0
instead of
(pure (-1.0)) . isKeyPressed leftKeyCode <|> (pure 0.0)
than "fromRational" gets called. I am wondering, if this is not pretty inefficient.
No, it's the same thing. When you write 'pure 1.0', then you're using, say, Double's Fractional instance directly. If you write just '1.0', then you're using Wire's Fractional instance, which is just defined as: fromRational = pure . fromRational So it's the same thing.
I am noticing this, because when I compile a netwire test program with haste, the first code segment fails during runtime because of the primOp newByteArray#.
Michael Snoyman has reported that Netwire 4 compiled fine using GHCJS. Give that one a try. Greets, Ertugrul -- Not to be or to be and (not to be or to be and (not to be or to be and (not to be or to be and ... that is the list monad.