Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,4 @@ script:
after_script:
- travis_retry curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.4.0/shc-linux-x64-$GHCVER.tar.bz2 | tar -xj
- |
[ "$BUILD" == stack -a "$GHCVER" == 7.10.3 ] && ./shc --partial-coverage regex re-gen-modules-test re-include-test re-nginx-log-processor-test re-pp-test re-tests re-tutorial-test
[ "$BUILD" == stack -a "$GHCVER" == 7.10.3 ] && ./shc --partial-coverage regex re-gen-cabals-test re-gen-modules-test re-include-test re-nginx-log-processor-test re-pp-test re-tests-test re-tutorial-test
4 changes: 2 additions & 2 deletions docs/Capture.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@
}
<span class="kw">deriving</span> (<span class="dt">Show</span>,<span class="dt">Eq</span>)</code></pre></div>
<div class="sourceCode"><pre class="sourceCode literate haskell"><code class="sourceCode haskell"><span class="kw">instance</span> <span class="dt">Functor</span> <span class="dt">Matches</span> <span class="kw">where</span>
fmap f <span class="dt">Matches</span>{<span class="fu">..</span>} <span class="fu">=</span>
fmap f <span class="dt">Matches</span>{<span class="fu">..</span>} <span class="fu">=</span>
<span class="dt">Matches</span>
{ matchesSource <span class="fu">=</span> f matchesSource
, allMatches <span class="fu">=</span> map (fmap f) allMatches
, allMatches <span class="fu">=</span> map (fmap f) allMatches
}

<span class="kw">instance</span> <span class="dt">Functor</span> <span class="dt">Match</span> <span class="kw">where</span>
Expand Down
6 changes: 2 additions & 4 deletions docs/re-tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,14 @@ <h1 id="the-regex-tutorial">The Regex Tutorial</h1>
cabal repl examples/re-tutorial.lhs</code></pre>
<p>Depending upon how you have configured and run <code>ghci</code> you may need to set one of <em>ghci</em>'s interctive settings — the topic of the next section.</p>
<h2 id="setting-up-the-pragmas">Setting Up: The Pragmas</h2>
First off, this pragma is a just technical pragma, combined with the <code>Prelude.Compat</code> import below used to avoid certain warnings while comiling against multiple versions of the compiler. It can be safely ignored.
<div class="sourceCode"><pre class="sourceCode literate haskell"><code class="sourceCode haskell"><span class="ot">{-# LANGUAGE NoImplicitPrelude #-}</span></code></pre></div>
<p>Haskell programs typically start with a few compiler pragmas to switch on the language extensions needed by the module. Because regex uses Template Haskell to check regular expressions at compile time <code>QuasiQuotes</code> should be enabled.</p>
<div class="sourceCode"><pre class="sourceCode literate haskell"><code class="sourceCode haskell"><span class="ot">{-# LANGUAGE QuasiQuotes #-}</span></code></pre></div>
<p>Use this command to configure ghci accordingly (not necessary if you have launched ghci with <code>cabal repl</code>):</p>
<pre><code>:seti -XQuasiQuotes</code></pre>
<a href="https://www.schoolofhaskell.com/school/to-infinity-and-beyond/pick-of-the-week/guide-to-ghc-extensions/basic-syntax-extensions#overloadedstrings">Overloaded string literals</a> are usually enabled in modern Haskell and we do so here.
<div class="sourceCode"><pre class="sourceCode literate haskell"><code class="sourceCode haskell"><span class="ot">{-# LANGUAGE OverloadedStrings #-}</span></code></pre></div>
Because we are mimicking the REPL in this tutorial we will leave off the type signatures on the example calculations and disable the compiler warnings about missing type signatures.
<div class="sourceCode"><pre class="sourceCode literate haskell"><code class="sourceCode haskell"><span class="ot">{-# OPTIONS_GHC -fno-warn-missing-signatures #-}</span></code></pre></div>
This pragma is a just technical pragma, combined with the <code>Prelude.Compat</code> import below used to avoid certain warnings while comiling against multiple versions of the compiler. It can be safely ignored.
<div class="sourceCode"><pre class="sourceCode literate haskell"><code class="sourceCode haskell"><span class="ot">{-# LANGUAGE NoImplicitPrelude #-}</span></code></pre></div>
<h2 id="loading-up-the-imports">Loading Up: The Imports</h2>
<p>We have two things to consider in the import to access the regex goodies, which will take the form:</p>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="kw">import </span><span class="dt">Text.RE</span>.&lt;regex-flavour&gt;.&lt;text-type&gt;?</code></pre></div>
Expand Down
1 change: 1 addition & 0 deletions examples/re-pp.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ main = do
[ "usage:"
, " "++prg "--help"
, " "++prg "[test]"
, " "++prg "badges"
, " "++prg "all"
, " "++prg "doc (-|<in-file>) (-|<out-file>)"
, " "++prg "gen (-|<in-file>) (-|<out-file>)"
Expand Down
23 changes: 8 additions & 15 deletions examples/re-tutorial-master.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ section.
Setting Up: The Pragmas
-----------------------

First off, this pragma is a just technical pragma, combined with the
`Prelude.Compat` import below used to avoid certain warnings while
comiling against multiple versions of the compiler. It can be safely
ignored.
\begin{code}
{-# LANGUAGE NoImplicitPrelude #-}
\end{code}

Haskell programs typically start with a few compiler pragmas to switch
on the language extensions needed by the module. Because regex uses
Template Haskell to check regular expressions at compile time `QuasiQuotes`
Expand All @@ -46,20 +38,21 @@ have launched ghci with `cabal repl`):
:seti -XQuasiQuotes
```

[Overloaded string
literals](https://www.schoolofhaskell.com/school/to-infinity-and-beyond/pick-of-the-week/guide-to-ghc-extensions/basic-syntax-extensions#overloadedstrings)
are usually enabled in modern Haskell and we do so here.
\begin{code}
{-# LANGUAGE OverloadedStrings #-}
\end{code}

Because we are mimicking the REPL in this tutorial we will leave off the type
signatures on the example calculations and disable the compiler
warnings about missing type signatures.
\begin{code}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
\end{code}

This pragma is a just technical pragma, combined with the
`Prelude.Compat` import below used to avoid certain warnings while
comiling against multiple versions of the compiler. It can be safely
ignored.
\begin{code}
{-# LANGUAGE NoImplicitPrelude #-}
\end{code}


Loading Up: The Imports
-----------------------
Expand Down
23 changes: 8 additions & 15 deletions examples/re-tutorial.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ section.
Setting Up: The Pragmas
-----------------------

First off, this pragma is a just technical pragma, combined with the
`Prelude.Compat` import below used to avoid certain warnings while
comiling against multiple versions of the compiler. It can be safely
ignored.
\begin{code}
{-# LANGUAGE NoImplicitPrelude #-}
\end{code}

Haskell programs typically start with a few compiler pragmas to switch
on the language extensions needed by the module. Because regex uses
Template Haskell to check regular expressions at compile time `QuasiQuotes`
Expand All @@ -46,20 +38,21 @@ have launched ghci with `cabal repl`):
:seti -XQuasiQuotes
```

[Overloaded string
literals](https://www.schoolofhaskell.com/school/to-infinity-and-beyond/pick-of-the-week/guide-to-ghc-extensions/basic-syntax-extensions#overloadedstrings)
are usually enabled in modern Haskell and we do so here.
\begin{code}
{-# LANGUAGE OverloadedStrings #-}
\end{code}

Because we are mimicking the REPL in this tutorial we will leave off the type
signatures on the example calculations and disable the compiler
warnings about missing type signatures.
\begin{code}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
\end{code}

This pragma is a just technical pragma, combined with the
`Prelude.Compat` import below used to avoid certain warnings while
comiling against multiple versions of the compiler. It can be safely
ignored.
\begin{code}
{-# LANGUAGE NoImplicitPrelude #-}
\end{code}


Loading Up: The Imports
-----------------------
Expand Down
84 changes: 53 additions & 31 deletions lib/regex-master.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ Build-type: Simple
Stability: rfc
bug-reports: https://github.com/iconnect/regex/issues

extra-source-files:
Extra-Source-Files:
README.md
changelog

Cabal-version: >= 1.16
Cabal-Version: >= 1.16

Source-repository head
Source-Repository head
type: git
location: https://github.com/iconnect/regex.git

Expand Down Expand Up @@ -60,7 +60,7 @@ Source-Repository this

Library
Hs-Source-Dirs: .
Exposed-modules:
Exposed-Modules:
Text.RE
Text.RE.Capture
Text.RE.CaptureID
Expand Down Expand Up @@ -92,108 +92,130 @@ Library
Text.RE.Tools.Lex
Text.RE.Tools.Sed

Other-modules:
Other-Modules:
Text.RE.Internal.AddCaptureNames

Default-Language: Haskell2010
GHC-Options:
-Wall
-fwarn-tabs

%build-depends array bytestring base base-compat containers hashable heredoc regex-base regex-tdfa regex-tdfa-text regex-pcre-builtin smallcheck tasty tasty-hunit tasty-smallcheck template-haskell transformers text time time-locale-compat unordered-containers

%test-exe re-gen-cabals
Hs-Source-Dirs: examples

Main-is: re-gen-cabals.lhs
Main-Is: re-gen-cabals.lhs

Other-modules:
Other-Modules:
TestKit

Default-Language: Haskell2010
GHC-Options:
-Wall
-fwarn-tabs
-Wall
-fwarn-tabs

%build-depends regex array base base-compat containers bytestring directory regex-base regex-tdfa shelly text

%test-exe re-gen-modules
Hs-Source-Dirs: examples

Main-is: re-gen-modules.lhs
Main-Is: re-gen-modules.lhs

Default-Language: Haskell2010
GHC-Options:
-Wall
-fwarn-tabs
-Wall
-fwarn-tabs

%build-depends regex array base base-compat bytestring directory regex-base regex-tdfa shelly text

%test-exe re-include
Hs-Source-Dirs: examples

Main-is: re-include.lhs
Main-Is: re-include.lhs

Default-Language: Haskell2010
GHC-Options:
-Wall
-fwarn-tabs
-Wall
-fwarn-tabs

Other-modules:
Other-Modules:
TestKit

%build-depends regex base base-compat bytestring directory shelly text

%test-exe re-nginx-log-processor
Hs-Source-Dirs: examples

Main-is: re-nginx-log-processor.lhs
Main-Is: re-nginx-log-processor.lhs

Default-Language: Haskell2010
GHC-Options:
-Wall
-fwarn-tabs
-Wall
-fwarn-tabs

%build-depends regex array base base-compat bytestring directory regex-base regex-tdfa shelly text time time-locale-compat transformers unordered-containers

%test-exe re-pp
Hs-Source-Dirs: examples

Main-is: re-pp.lhs
Main-Is: re-pp.lhs

Default-Language: Haskell2010
GHC-Options:
-Wall
-fwarn-tabs
-Wall
-fwarn-tabs

Other-modules:
Other-Modules:
TestKit

%build-depends regex base base-compat bytestring directory http-conduit shelly text

%test-exe re-tests
Hs-Source-Dirs: examples

Main-is: re-tests.lhs
Main-Is: re-tests.lhs

Default-Language: Haskell2010
GHC-Options:
-Wall
-fwarn-tabs
-Wall
-fwarn-tabs

Other-modules:
Other-Modules:
TestKit

%build-depends regex array base base-compat bytestring containers directory regex-base regex-tdfa regex-tdfa-text regex-pcre-builtin tasty tasty-hunit template-haskell text

%test-exe re-tutorial
Hs-Source-Dirs: examples

Main-is: re-tutorial.lhs
Main-Is: re-tutorial.lhs

Other-Modules:
TestKit

Default-Language: Haskell2010
Default-Extensions: QuasiQuotes
GHC-Options:
-Wall
-fwarn-tabs

%build-depends regex array base base-compat bytestring containers directory hashable heredoc regex-base regex-tdfa regex-tdfa-text regex-pcre-builtin shelly smallcheck tasty tasty-hunit tasty-smallcheck template-haskell transformers text time time-locale-compat unordered-containers

%test re-tutorial-os
Hs-Source-Dirs: examples

Main-Is: re-tutorial.lhs

Other-modules:
Other-Modules:
TestKit

Default-Language: Haskell2010
Extensions: OverloadedStrings
Default-Extensions: QuasiQuotes
GHC-Options:
-Wall
-fwarn-tabs
-Wall
-fwarn-tabs

%build-depends regex array base base-compat bytestring containers directory hashable heredoc regex-base regex-tdfa regex-tdfa-text regex-pcre-builtin shelly smallcheck tasty tasty-hunit tasty-smallcheck template-haskell transformers text time time-locale-compat unordered-containers

Expand Down
Loading