With ghcjs the below code results in output [1.0,5.299808824e-315]
import qualified Data.Vector.Storable as S
import qualified Data.Vector.Storable.Mutable as SM
vecSet = do
v <- SM.new 2
SM.set v (1.0 :: Double)
print =<< S.freeze v
The problematic code is here, this causes the use of primitive Word64 operations which dont work for Double as their underlying representation is different.
|
8 -> storableSetAsPrim n fp x (undefined :: Word64) |