fay-text 0.3 → 0.3.0.1
raw patch · 4 files changed
+40/−11 lines, 4 filesdep ~faydep ~fay-basedep ~text
Dependency ranges changed: fay, fay-base, text
Files
- CHANGELOG.md +5/−3
- fay-text.cabal +6/−5
- src/Fay/Text.hs +26/−2
- src/Fay/Text/Type.hs +3/−1
CHANGELOG.md view
@@ -1,16 +1,18 @@ ## Changelog -### 0.3 (2013-11-07)+#### 0.3.0.1 (2014-01-14 +## 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)+## 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)+## 0.1.0.0 (2013-08-27) * Initial release
fay-text.cabal view
@@ -1,5 +1,5 @@ name: fay-text-version: 0.3+version: 0.3.0.1 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@@ -7,7 +7,7 @@ license: MIT license-file: LICENSE author: Michael Snoyman, Adam Bergmark-maintainer: adam@edea.se+maintainer: adam@bergmark.nl copyright: 2013 Michael Snoyman, Adam Bergmark category: Data, Fay, Text build-type: Simple@@ -25,6 +25,7 @@ exposed: False hs-source-dirs: src exposed-modules: Fay.Text, Fay.Text.Type- build-depends: text- , fay >= 0.18- , fay-base >= 0.18+ ghc-options: -Wall+ build-depends: text < 1.2+ , fay == 0.19.*+ , fay-base == 0.19.*
src/Fay/Text.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE PackageImports #-} -- | Module to be shared between server and client. --@@ -36,11 +35,11 @@ , minimum ) where -import Data.Data import Fay.Text.Type import Prelude (Bool, Char, Int, Maybe) #ifdef FAY+import Data.Data import FFI empty :: Text@@ -157,29 +156,54 @@ -- TODO zip, zipWith #else+ import qualified Data.Text as T +empty :: Text empty = T.empty+cons :: Char -> Text -> Text cons = T.cons+snoc :: Text -> Char -> Text snoc = T.snoc+append :: Text -> Text -> Text append = T.append+uncons :: Text -> Maybe (Char, Text) uncons = T.uncons+head :: Text -> Char head = T.head+last :: Text -> Char last = T.last+tail :: Text -> Text tail = T.tail+init :: Text -> Text init = T.init+null :: Text -> Bool null = T.null+length :: Text -> Int length = T.length+map :: (Char -> Char) -> Text -> Text map = T.map+intercalate :: Text -> [Text] -> Text intercalate = T.intercalate+intersperse :: Char -> Text -> Text intersperse = T.intersperse+reverse :: Text -> Text reverse = T.reverse+toLower :: Text -> Text toLower = T.toLower+toUpper :: Text -> Text toUpper = T.toUpper+concat :: [Text] -> Text concat = T.concat+concatMap :: (Char -> Text) -> Text -> Text concatMap = T.concatMap+any :: (Char -> Bool) -> Text -> Bool any = T.any+all :: (Char -> Bool) -> Text -> Bool all = T.all+maximum :: Text -> Char maximum = T.maximum+minimum :: Text -> Char minimum = T.minimum+ #endif
src/Fay/Text/Type.hs view
@@ -16,8 +16,10 @@ ) where import Prelude-import Data.Data+ #ifdef FAY++import Data.Data import FFI data Text