doubleToWord :: Double -> Word64
doubleToWord (D# x) = runST $ ST $ \s1 ->
    case newByteArray# 8# s1 of
        (# s2, mbarr #) ->
            let !s3 = writeDoubleArray# mbarr 0# x s2
             in case readWord64Array# mbarr 0# s3 of
                    (# s4, w #) -> (# s4, W64# w #)

doubleToWord :: Double -> Word64
doubleToWord (D# x) = runST $ ST $ \s1 ->
    case newByteArray# 8# s1 of
        (# s2, mbarr #) ->
            let !s3 = writeDoubleArray# mbarr 0# x s2
             in case readWord64Array# mbarr 0# s3 of
                    (# s4, w #) -> (# s4, W64# w #)

doubleToWord (D# x) = runST $ ST $ \s1 ->
    case newByteArray# 8# s1 of
        (# s2, mbarr #) ->
            let !s3 = writeDoubleArray# mbarr 0# x s2
             in case readWord64Array# mbarr 0# s3 of
                    (# s4, w #) -> (# s4, W64# w #)
