packages feed

fay-text 0.2.0.0 → 0.3

raw patch · 4 files changed

+30/−3 lines, 4 files

Files

+ CHANGELOG.md view
@@ -0,0 +1,16 @@+## Changelog++### 0.3 (2013-11-07)++* Add Ord instance for Text (okay because JS comparison operators work on the values)+* Make Text an EmptyDataDecl++### 0.2.0.0 (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.++### 0.1.0.0 (2013-08-27)++* Initial release
+ README.md view
@@ -0,0 +1,7 @@+[Changelog](CHANGELOG.md)++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.
fay-text.cabal view
@@ -1,5 +1,5 @@ name:                fay-text-version:             0.2.0.0+version:             0.3 synopsis:            Fay Text type represented as JavaScript strings description:         Text type represented as JavaScript strings for Fay and Data.Text for GHC. Use with OverloadedStrings and RebindableSyntax to have Fay treat string literals as Text. homepage:            https://github.com/faylang/fay-text@@ -12,6 +12,9 @@ category:            Data, Fay, Text build-type:          Simple cabal-version:       >=1.8+extra-source-files:+  README.md+  CHANGELOG.md data-files: src/Fay/Text.hs, src/Fay/Text/Type.hs  source-repository head
src/Fay/Text/Type.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE CPP                #-} {-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE EmptyDataDecls     #-}  -- | Module to be shared between server and client. --@@ -19,8 +20,8 @@ #ifdef FAY import           FFI -data Text = Text-  deriving (Show, Read, Eq, Typeable, Data)+data Text+  deriving (Data, Eq, Ord, Read, Show, Typeable)  pack :: String -> Text pack = ffi "%1"