[Haskell] Platform-dependent behaviour with functions on NaN