text-regex-replace 0.1.1.1 → 0.1.1.2
raw patch · 3 files changed
+59/−59 lines, 3 filesdep ~QuickCheckdep ~basedep ~hspecPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: QuickCheck, base, hspec, smallcheck
API changes (from Hackage documentation)
- Data.Text.ICU.Replace: instance IsString Replace
- Data.Text.ICU.Replace: instance Monoid Replace
+ Data.Text.ICU.Replace: instance Data.Semigroup.Semigroup Data.Text.ICU.Replace.Replace
+ Data.Text.ICU.Replace: instance Data.String.IsString Data.Text.ICU.Replace.Replace
+ Data.Text.ICU.Replace: instance GHC.Base.Monoid Data.Text.ICU.Replace.Replace
Files
- specs/Data/Text/ICU/ReplaceSpec.hs +0/−4
- src/Data/Text/ICU/Replace.hs +11/−3
- text-regex-replace.cabal +48/−52
specs/Data/Text/ICU/ReplaceSpec.hs view
@@ -4,11 +4,7 @@ module Data.Text.ICU.ReplaceSpec where -import qualified Data.Text as T-import Data.Text.ICU-import qualified Data.Text.ICU as ICU import Data.Text.ICU.Replace-import Data.Text.Lazy.Builder import Test.Hspec
src/Data/Text/ICU/Replace.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-}+{-# LANGUAGE CPP #-} {-| @@ -37,9 +38,11 @@ import Control.Applicative-import Control.Arrow import Data.Attoparsec.Text import Data.Foldable+#if __GLASGOW_HASKELL__ < 804+import Data.Semigroup (Semigroup)+#endif import Data.Monoid import Data.String import qualified Data.Text as T@@ -51,6 +54,7 @@ import Prelude hiding (span) + -- | A 'Replace' instance is a function from a regular expression match to -- a 'Data.Text.Lazy.Builder.Builder'. This naturally forms a 'Monoid', so -- they're easy to combine.@@ -58,7 +62,11 @@ -- 'Replace' also implements 'IsString', so raw strings can be used to -- construct them. newtype Replace = Replace { unReplace :: Match -> TB.Builder } deriving- (Monoid)+ ( Monoid+#if __GLASGOW_HASKELL__ < 804+ , Semigroup+#endif+ ) instance IsString Replace where fromString = parseReplace . T.pack@@ -102,7 +110,7 @@ step :: (Last MatchState, TB.Builder) -> Match -> (Last MatchState, TB.Builder)- step lstep@(Last prev, buffer) m =+ step (Last prev, buffer) m = let s = span m g = fold $ group 0 m offset = (+ T.length s) . (+ T.length g) $ maybe 0 snd prev
text-regex-replace.cabal view
@@ -1,57 +1,53 @@--- Initial text-regex-replace.cabal generated by cabal init. For further --- documentation, see http://haskell.org/cabal/users-guide/--name: text-regex-replace-version: 0.1.1.1-synopsis: Easy replacement when using text-icu regexes.+name: text-regex-replace+version: 0.1.1.2+cabal-version: >=1.10+build-type: Simple+license: Apache-2.0+license-file: LICENSE+maintainer: erochest@gmail.com+synopsis: Easy replacement when using text-icu regexes. description:- This provides a convenient API for doing replacements off of a regular- expression, similar to what regex libraries in other languages provide.- .- At this point, this hasn't been used enough to have any idea of its- performance. Caveat emptor.-license: Apache-2.0-license-file: LICENSE-author: Eric Rochester-maintainer: erochest@gmail.com--- copyright: -category: Data, Text-build-type: Simple--- extra-source-files: -cabal-version: >=1.10--library- exposed-modules: Data.Text.ICU.Replace- -- other-modules: - -- other-extensions: - build-depends: base >= 4.7 && <5- , attoparsec >= 0.12 && <0.14- , text >= 1.2 && <1.3- , text-icu >= 0.7 && <0.8- hs-source-dirs: src- default-language: Haskell2010--test-suite text-regex-replace-specs- type: exitcode-stdio-1.0- ghc-options: -threaded -rtsopts- hs-source-dirs: specs- main-is: Specs.hs- other-modules: Data.Text.ICU.ReplaceSpec- build-depends: base- , text-regex-replace- , QuickCheck- , smallcheck- , hspec- , text >= 1.2 && <1.3- , text-icu >= 0.7 && <0.8- default-language: Haskell2010-+ This provides a convenient API for doing replacements off of a regular+ expression, similar to what regex libraries in other languages provide.+ .+ At this point, this hasn't been used enough to have any idea of its+ performance. Caveat emptor.+category: Data, Text+author: Eric Rochester source-repository head- type: git- location: git://github.com/erochest/text-regex-replace.git+ type: git+ location: git://github.com/erochest/text-regex-replace.git source-repository this- type: git- tag: 0.1.0.1- location: git://github.com/erochest/text-regex-replace.git+ type: git+ location: git://github.com/erochest/text-regex-replace.git+ tag: 0.1.0.1++library+ exposed-modules:+ Data.Text.ICU.Replace+ build-depends:+ base >=4.7 && <5,+ attoparsec >=0.12 && <0.14,+ text ==1.2.*,+ text-icu ==0.7.*+ default-language: Haskell2010+ hs-source-dirs: src++test-suite text-regex-replace-specs+ type: exitcode-stdio-1.0+ main-is: Specs.hs+ build-depends:+ base >=4.10.1.0,+ text-regex-replace -any,+ QuickCheck >=2.10.1,+ smallcheck >=1.1.3.1,+ hspec >=2.4.8,+ text ==1.2.*,+ text-icu ==0.7.*+ default-language: Haskell2010+ hs-source-dirs: specs+ other-modules:+ Data.Text.ICU.ReplaceSpec+ ghc-options: -threaded -rtsopts