summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattMorrow <>2008-06-25 06:24:00 (GMT)
committerLuite Stegeman <luite@luite.com>2008-06-25 06:24:00 (GMT)
commit80a6aae459229baf433b4501b91198d2a67f55bc (patch)
tree5ff0b66d76efc305258378ee0300cb0aa9c7b8fb
parent1572e792f6d612767bb036407d5261e2f2374ba8 (diff)
version 0.20.2
-rw-r--r--Text/Regex/PCRE/QQ.hs10
-rw-r--r--regexqq.cabal18
2 files changed, 14 insertions, 14 deletions
diff --git a/Text/Regex/PCRE/QQ.hs b/Text/Regex/PCRE/QQ.hs
index 72996e8..26afdcc 100644
--- a/Text/Regex/PCRE/QQ.hs
+++ b/Text/Regex/PCRE/QQ.hs
@@ -77,12 +77,12 @@ rx = QuasiQuoter
regexToExpQ :: String -> ExpQ
regexToExpQ s = case PCRE.compileM (pack s) pcreOpts of
Left err -> error err
- -- Give an error at compile time
- -- if the regex string is invalid
- Right _ -> [|
+ -- Give an error at compile time
+ -- if the regex string is invalid
+ Right _ -> [|
(return . fmap unpack =<<)
- . match (regex s) . pack
- |]
+ . match (regex s) . pack
+ |]
-- | Transform a string (presumably)
-- containing a regex to a PatQ.
diff --git a/regexqq.cabal b/regexqq.cabal
index 31e1e8e..50f7731 100644
--- a/regexqq.cabal
+++ b/regexqq.cabal
@@ -1,5 +1,5 @@
name: regexqq
-version: 0.1
+version: 0.2
cabal-version: >= 1.2
build-type: Simple
license: BSD3
@@ -10,14 +10,14 @@ copyright: Matt Morrow
maintainer: Matt Morrow <morrow@jypsis.com>
stability: unstable
synopsis: A quasiquoter for PCRE regexes.
-description: > [$rx|([aeiou]).*(er|ing|tion)([\.,!\?]*)$|] "helloing.!?!?!"
- > Just ["elloing.!?!?!","e","ing",".!?!?!"]
- >
- > ghci> tail `fmap` [$rx|^([+-])?([0-9]+)\.([0-9]+)|] (show $ negate pi)
- > Just ["-","3","141592653589793"]
- >
- > ghci> maybe [] tail $ [$rx|^([+-])?([0-9]+)\.([0-9]+)|] (show $ negate pi)
- > ["-","3","141592653589793"]
+description: A quasiquoter for Text.Regex.PCRE regexes.
+ This makes use of a new GHC extension known as QuasiQuotes.
+ QuasiQuotes do not appear in ghc until 6.9, BUT there is a
+ patch for ghc-6.8.3 which adds quasiquote functionality. A
+ pathed version of ghc-6.8.3 is located at
+ <http://code.haskell.org/~morrow/quasiquotes/ghc-6.8.3_QQ-0.1.tar.bz2>.
+ An example of the use of @regexqq@ is located at
+ <http://code.haskell.org/~morrow/quasiquotes/regexqq.txt>
library
build-depends: base, bytestring, template-haskell >= 2.2, pcre-light