Data.Char
isn't in fay-base yet (see https://github.com/faylang/fay/issues/377) and there is only an enum instance for Int
, but I'll add ord and chr. Here's how to do it until then:
chr :: Int -> Char
chr = ffi "String.fromCharCode(%1)"
ord :: Char -> Int
ord = ffi "%1.charCodeAt(0)"