Haskell functions for Javascript

These are Haskell's functions ported to javascript.