Making the Haskell match the JavaScript