Learn Haskell building Prelude function for javascript