Fay Text type represented as JavaScript strings


Version on this page:
LTS Haskell 8.24:
Stackage Nightly 2017-06-26:
Latest on Hackage:

See all snapshots fay-text appears in

MIT licensed by Michael Snoyman, Adam Bergmark
Maintained by [email protected]
This version can be pinned in stack with:fay-text-,1151

Module documentation for

Depends on 3 packages(full list with versions):
Used by 1 package in lts-8.24(full list with versions):


fay-text provides a Text whose values are represented as JavaScript strings for Fay, and as Data.Text for GHC. You can use this package instead of directly depending on text if you want to.

Fay has a special case that’s applicable for fay-text. If a file has {-# LANGUAGE OverloadedStrings #-} GHC will replace all string literals with fromString lit. {-# LANGUAGE RebindableSyntax #-} tells GHC to use the fromString currently in scope instead of Data.String.fromString. With these two extensions enabled Fay outputs all string literals as JavaScript strings, which is the same representation as Fay.Text uses.

Note that you can mix modules using text literals and string literals, the behavior is local to the module.


Changelog (2015-02-11)

  • Allow fay 0.23.*
  • Allow fay-base 0.20.* (2015-01-05)

  • Allow fay 0.22.*.

0.3.2 (2014-10-21)

  • fay-text is now purely a compatibility layer between Fay and GHC. For Fay we reexport Data.Text from fay-base.

0.3.1 (2014-10-11)

  • Allow fay 0.21 (2014-04-29)

  • Allow fay 0.20 (2014-01-14)

  • Fix complation warnings

0.3 (2013-11-07)

  • Add Ord instance for Text (okay because JS comparison operators work on the values)
  • Make Text an EmptyDataDecl (2013-09-24)

  • Added a (large) subset of functions from Data.Text. These use the FFI so they should be pretty fast.
  • Added Eq instance for Text.
  • The Text type has been moved to Fay.Text.Type (re-exported by Fay.Text) in case you only want the type. (2013-08-27)

  • Initial release