you could try cross-compiling it with Fay or UHC (haskell to javascript compilers)
You'd probably need one of the more heavyweight options (e.g. GHCJS). Fay doesn't understand typeclasses afaik, so it's not really suitable for porting haskell libraries verbatim to the browser.