packages feed

regex-examples 1.0.0.0 → 1.0.1.0

raw patch · 31 files changed

+2727/−727 lines, 31 filesdep +blaze-htmldep +data-defaultdep ~arraydep ~base-compatdep ~bytestringnew-component:exe:re-top

Dependencies added: blaze-html, data-default

Dependency ranges changed: array, base-compat, bytestring, containers, filepath, hashable, regex, regex-base, regex-pcre-builtin, regex-tdfa, regex-tdfa-text, regex-with-pcre, template-haskell, text, time, time-locale-compat, transformers, unordered-containers

Files

README.markdown view
@@ -34,51 +34,9 @@  ## Road Map -    ☒  2017-01-26  v0.0.0.1  Pre-release (I)--    ☒  2017-01-30  v0.0.0.2  Pre-release (II)--    ☒  2017-02-18  v0.1.0.0  [Proposed core API with presentable Haddocks](https://github.com/iconnect/regex/milestone/1)--    ☒  2017-02-19  v0.2.0.0  [Package split into regex and regex-examples](https://github.com/iconnect/regex/milestone/5)--    ☒  2017-02-20  v0.2.0.1  [Remove library from regex-examples](https://github.com/iconnect/regex/issues/43)--    ☒  2017-02-21  v0.2.0.2  [Fix tests for Hackage](https://github.com/iconnect/regex/issues/45)--    ☒  2017-02-21  v0.2.0.3  Tweak README/index layout--    ☒  2017-02-22  v0.2.0.4  [Repair re-gen-modules-test for Windows](https://github.com/iconnect/regex/issues/47)--    ☒  2017-02-26  v0.3.0.0  [API adjustments](https://github.com/iconnect/regex/milestone/2)--    ☒  2017-03-05  v0.5.0.0  [Ready for review: API, tutorials and examples finalized](https://github.com/iconnect/regex/issues/67)--    ☒  2017-03-13  v0.6.0.0  [Split out PCRE](https://github.com/iconnect/regex/milestone/7)--    ☒  2017-03-13  v0.6.0.1  [Fix .travis.yml release-stack script](https://github.com/iconnect/regex/issues/67)--    ☒  2017-03-15  v0.7.0.0  [Better organization of API](https://github.com/iconnect/regex/milestone/8)--    ☒  2017-03-16  v0.8.0.0  [Tidy up the API](https://github.com/iconnect/regex/milestone/10)--    ☒  2017-03-24  v0.9.0.0  [Finish tidying up the API, Add type-safe replacement templates and exploit TemplateHaskellQuotes](https://github.com/iconnect/regex/milestone/9)--    ☒  2017-03-27  v0.10.0.2 [Tweak Templates, Fix release scripts and update Haddocks commentary](https://github.com/iconnect/regex/milestone/12)--    ☒  2017-03-28  v0.10.0.3 [Upgrade to LTS 8.6 and Improve Haddocks for Text.RE.{TDFA,PCRE}](https://github.com/iconnect/regex/milestone/13)--    ☒  2017-03-29  v0.11.0.0 [Simplify the API](https://github.com/iconnect/regex/milestone/14)--    ☒  2017-03-30  v0.11.1.0 [Fix the Haddocks](https://github.com/iconnect/regex/milestone/15)--    ☒  2017-03-31  v0.12.0.0 [Move IsRegex into Text.RE](https://github.com/iconnect/regex/milestone/16)--    ☒  2017-04-03  v0.13.0.0 [Protect findCaptureID and add Find, re-sort-imports](https://github.com/iconnect/regex/milestone/17)--    ☒  2017-04-04  v0.14.0.0 [Move IsOption, rename Find functions](https://github.com/iconnect/regex/milestone/18)-     ☒  2017-04-10  v1.0.0.0  [First stable release](https://github.com/iconnect/regex/milestone/3)++    ☒  2017-06-03  v1.0.1.0  [PCRE.Text, strict PVP, Update Stackage vrns, add re-top](https://github.com/iconnect/regex/milestone/19)      ☐  2017-08-31  v2.0.0.0  [Fast text replacement with benchmarks](https://github.com/iconnect/regex/milestone/4) 
changelog view
@@ -1,5 +1,11 @@ -*-change-log-*- +1.0.1.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-06-05+  * Text.RE.PCRE.Text[.Lazy] (#58)+  * Update LSTHaskell versions (#136)+  * Add re-top example (#137)+  * Regex library to conform with strict PVP (#138)+ 1.0.0.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-04-10   * Rewrite tutorials (#113)   * Add Text.RE.Tools.IsRegex (#122)
+ data/2015-16-premierleague.txt view
@@ -0,0 +1,563 @@+####################################+# English Premier League 2015/16+++Matchday 1++[Sat Aug/8]+  Manchester United      1-0  Tottenham Hotspur+  AFC Bournemouth        0-1  Aston Villa+  Everton FC             2-2  Watford FC+  Leicester City         4-2  Sunderland AFC+  Norwich City           1-3  Crystal Palace+  Chelsea FC             2-2  Swansea City+[Sun Aug/9]+  Arsenal FC             0-2  West Ham United+  Newcastle United       2-2  Southampton FC+  Stoke City             0-1  Liverpool FC+[Mon Aug/10]+  West Bromwich Albion   0-3  Manchester City++Matchday 2++[Fri Aug/14]+  Aston Villa            0-1  Manchester United+[Sat Aug/15]+  Southampton FC         0-3  Everton FC+  Sunderland AFC         1-3  Norwich City+  Swansea City           2-0  Newcastle United+  Tottenham Hotspur      2-2  Stoke City+  Watford FC             0-0  West Bromwich Albion+  West Ham United        1-2  Leicester City+[Sun Aug/16]+  Crystal Palace         1-2  Arsenal FC+  Manchester City        3-0  Chelsea FC+[Mon Aug/17]+  Liverpool FC           1-0  AFC Bournemouth++Matchday 3+[Sat Aug/22]+  Manchester United      0-0  Newcastle United+  Crystal Palace         2-1  Aston Villa+  Leicester City         1-1  Tottenham Hotspur+  Norwich City           1-1  Stoke City+  Sunderland AFC         1-1  Swansea City+  West Ham United        3-4  AFC Bournemouth+[Sun Aug/23]+  West Bromwich Albion   2-3  Chelsea FC+  Everton FC             0-2  Manchester City+  Watford FC             0-0  Southampton FC+[Mon Aug/24]+  Arsenal FC             0-0  Liverpool FC++Matchday 4+[Sat Aug/29]+  Newcastle United       0-1  Arsenal FC+  AFC Bournemouth        1-1  Leicester City+  Aston Villa            2-2  Sunderland AFC+  Chelsea FC             1-2  Crystal Palace+  Liverpool FC           0-3  West Ham United+  Manchester City        2-0  Watford FC+  Stoke City             0-1  West Bromwich Albion+  Tottenham Hotspur      0-0  Everton FC+[Sun Aug/30]+  Southampton FC         3-0  Norwich City+  Swansea City           2-1  Manchester United++Matchday 5++[Sat Sept/12]+  Everton FC             3-1  Chelsea FC+  Arsenal FC             2-0  Stoke City+  Crystal Palace         0-1  Manchester City+  Norwich City           3-1  AFC Bournemouth+  Watford FC             1-0  Swansea City+  West Bromwich Albion   0-0  Southampton FC+  Manchester United      3-1  Liverpool FC+[Sun Sept/13]+  Sunderland AFC         0-1  Tottenham Hotspur+  Leicester City         3-2  Aston Villa+[Mon Sept/14]+  West Ham United        2-0  Newcastle United++Matchday 6++[Sat Sept/19]+  Chelsea FC             2-0  Arsenal FC+  AFC Bournemouth        2-0  Sunderland AFC+  Aston Villa            0-1  West Bromwich Albion+  Newcastle United       1-2  Watford FC+  Stoke City             2-2  Leicester City+  Swansea City           0-0  Everton FC+  Manchester City        1-2  West Ham United+[Sun Sept/20]+  Tottenham Hotspur      1-0  Crystal Palace+  Liverpool FC           1-1  Norwich City+  Southampton FC         2-3  Manchester United++Matchday 7++[Sat Sept/26]+  Tottenham Hotspur      4-1  Manchester City+  Leicester City         2-5  Arsenal FC+  Liverpool FC           3-2  Aston Villa+  Manchester United      3-0  Sunderland AFC+  Southampton FC         3-1  Swansea City+  Stoke City             2-1  AFC Bournemouth+  West Ham United        2-2  Norwich City+  Newcastle United       2-2  Chelsea FC+[Sun Sept/27]+  Watford FC             0-1  Crystal Palace+[Mon Sept/28]+  West Bromwich Albion   2-3  Everton FC++Matchday 8+[Sat Oct/3]+  AFC Bournemouth        1-1  Watford FC+  Arsenal FC             3-0  Manchester United+  Aston Villa            0-1  Stoke City+  Chelsea FC             1-3  Southampton FC+  Crystal Palace         2-0  West Bromwich Albion+  Everton FC             1-1  Liverpool FC+  Manchester City        6-1  Newcastle United+  Norwich City           1-2  Leicester City+  Sunderland AFC         2-2  West Ham United+  Swansea City           2-2  Tottenham Hotspur++Matchday 9+[Sat Oct/17]+Chelsea FC               2-0  Aston Villa+Crystal Palace           1-3  West Ham United+Everton FC               0-3  Manchester United+Manchester City          5-1  AFC Bournemouth+Newcastle United         6-2  Norwich City+Southampton FC           2-2  Leicester City+Swansea City             0-1  Stoke City+Tottenham Hotspur        0-0  Liverpool FC+Watford FC               0-3  Arsenal FC+West Bromwich Albion     1-0  Sunderland AFC++Matchday 10+[Sat Oct/24]+AFC Bournemouth          1-5  Tottenham Hotspur+Arsenal FC               2-1  Everton FC+Aston Villa              1-2  Swansea City+Leicester City           1-0  Crystal Palace+Liverpool FC             1-1  Southampton FC+Manchester United        0-0  Manchester City+Norwich City             0-1  West Bromwich Albion+Stoke City               0-2  Watford FC+Sunderland AFC           3-0  Newcastle United+West Ham United          2-1  Chelsea FC++Matchday 11+[Sat Oct/31]+Chelsea FC               1-3  Liverpool FC+Crystal Palace           0-0  Manchester United+Everton FC               6-2  Sunderland AFC+Manchester City          2-1  Norwich City+Newcastle United         0-0  Stoke City+Southampton FC           2-0  AFC Bournemouth+Swansea City             0-3  Arsenal FC+Tottenham Hotspur        3-1  Aston Villa+Watford FC               2-0  West Ham United+West Bromwich Albion     2-3  Leicester City++Matchday 12+[Sat Nov/7]+AFC Bournemouth          0-1  Newcastle United+Arsenal FC               1-1  Tottenham Hotspur+Aston Villa              0-0  Manchester City+Leicester City           2-1  Watford FC+Liverpool FC             1-2  Crystal Palace+Manchester United        2-0  West Bromwich Albion+Norwich City             1-0  Swansea City+Stoke City               1-0  Chelsea FC+Sunderland AFC           0-1  Southampton FC+West Ham United          1-1  Everton FC++Matchday 13+[Sat Nov/21]+Chelsea FC               1-0  Norwich City+Crystal Palace           0-1  Sunderland AFC+Everton FC               4-0  Aston Villa+Manchester City          1-4  Liverpool FC+Newcastle United         0-3  Leicester City+Southampton FC           0-1  Stoke City+Swansea City             2-2  AFC Bournemouth+Tottenham Hotspur        4-1  West Ham United+Watford FC               1-2  Manchester United+West Bromwich Albion     2-1  Arsenal FC++Matchday 14+[Sat Nov/28]+AFC Bournemouth          3-3  Everton FC+Aston Villa              2-3  Watford FC+Crystal Palace           5-1  Newcastle United+Leicester City           1-1  Manchester United+Liverpool FC             1-0  Swansea City+Manchester City          3-1  Southampton FC+Norwich City             1-1  Arsenal FC+Sunderland AFC           2-0  Stoke City+Tottenham Hotspur        0-0  Chelsea FC+West Ham United          1-1  West Bromwich Albion++Matchday 15+[Sat Dec/5]+Arsenal FC               3-1  Sunderland AFC+Chelsea FC               0-1  AFC Bournemouth+Everton FC               1-1  Crystal Palace+Manchester United        0-0  West Ham United+Newcastle United         2-0  Liverpool FC+Southampton FC           1-1  Aston Villa+Stoke City               2-0  Manchester City+Swansea City             0-3  Leicester City+Watford FC               2-0  Norwich City+West Bromwich Albion     1-1  Tottenham Hotspur++Matchday 16+[Sat Dec/12]+AFC Bournemouth          2-1  Manchester United+Aston Villa              0-2  Arsenal FC+Crystal Palace           1-0  Southampton FC+Leicester City           2-1  Chelsea FC+Liverpool FC             2-2  West Bromwich Albion+Manchester City          2-1  Swansea City+Norwich City             1-1  Everton FC+Sunderland AFC           0-1  Watford FC+Tottenham Hotspur        1-2  Newcastle United+West Ham United          0-0  Stoke City++Matchday 17+[Sat Dec/19]+Arsenal FC               2-1  Manchester City+Chelsea FC               3-1  Sunderland AFC+Everton FC               2-3  Leicester City+Manchester United        1-2  Norwich City+Newcastle United         1-1  Aston Villa+Southampton FC           0-2  Tottenham Hotspur+Stoke City               1-2  Crystal Palace+Swansea City             0-0  West Ham United+Watford FC               3-0  Liverpool FC+West Bromwich Albion     1-2  AFC Bournemouth++Matchday 18+[Sat Dec/26]+AFC Bournemouth          0-0  Crystal Palace+Aston Villa              1-1  West Ham United+Chelsea FC               2-2  Watford FC+Liverpool FC             1-0  Leicester City+Manchester City          4-1  Sunderland AFC+Newcastle United         0-1  Everton FC+Southampton FC           4-0  Arsenal FC+Stoke City               2-0  Manchester United+Swansea City             1-0  West Bromwich Albion+Tottenham Hotspur        3-0  Norwich City++Matchday 19+[Mon Dec/28]+Arsenal FC               2-0  AFC Bournemouth+Crystal Palace           0-0  Swansea City+Everton FC               3-4  Stoke City+Leicester City           0-0  Manchester City+Manchester United        0-0  Chelsea FC+Norwich City             2-0  Aston Villa+Sunderland AFC           0-1  Liverpool FC+Watford FC               1-2  Tottenham Hotspur+West Bromwich Albion     1-0  Newcastle United+West Ham United          2-1  Southampton FC++###################################+# English Premier League 2015/16+++Matchday 20+[Sat Jan/2]+Arsenal FC              1-0  Newcastle United+Leicester City          0-0  AFC Bournemouth+Manchester United       2-1  Swansea City+Norwich City            1-0  Southampton FC+Sunderland AFC          3-1  Aston Villa+Watford FC              1-2  Manchester City+West Bromwich Albion    2-1  Stoke City+West Ham United         2-0  Liverpool FC+[Sun Jan/3]+Crystal Palace          0-3  Chelsea FC+Everton FC              1-1  Tottenham Hotspur++Matchday 21+[Tue Jan/12]+  AFC Bournemouth       1-3  West Ham United+  Aston Villa           1-0  Crystal Palace+  Liverpool FC          3-3  Arsenal FC+  Swansea City          2-4  Sunderland AFC+[Wed Jan/13]+  Chelsea FC            2-2  West Bromwich Albion+  Manchester City       0-0  Everton FC+  Newcastle United      3-3  Manchester United+  Southampton FC        2-0  Watford FC+  Stoke City            3-1  Norwich City+  Tottenham Hotspur     0-1  Leicester City++Matchday 22+[Sat Jan/16]+AFC Bournemouth         3-0  Norwich City+Aston Villa             1-1  Leicester City+Chelsea FC              3-3  Everton FC+Manchester City         4-0  Crystal Palace+Newcastle United        2-1  West Ham United+Southampton FC          3-0  West Bromwich Albion+Tottenham Hotspur       4-1  Sunderland AFC+[Sun Jan/17]+Liverpool FC            0-1  Manchester United+Stoke City              0-0  Arsenal FC+[Mon Jan/18]+Swansea City            1-0  Watford FC++Matchday 23+[Sat Jan/23]+  Crystal Palace        1-3  Tottenham Hotspur+  Leicester City        3-0  Stoke City+  Manchester United     0-1  Southampton FC+  Norwich City          4-5  Liverpool FC+  Sunderland AFC        1-1  AFC Bournemouth+  Watford FC            2-1  Newcastle United+  West Bromwich Albion  0-0  Aston Villa+  West Ham United       2-2  Manchester City+[Sun Jan/24]+  Arsenal FC            0-1  Chelsea FC+  Everton FC            1-2  Swansea City++Matchday 24+[Tue Feb/2]+  Arsenal FC            0-0  Southampton FC+  Crystal Palace        1-2  AFC Bournemouth+  Leicester City        2-0  Liverpool FC+  Manchester United     3-0  Stoke City+  Norwich City          0-3  Tottenham Hotspur+  Sunderland AFC        0-1  Manchester City+  Watford FC            0-0  Chelsea FC+  West Bromwich Albion  1-1  Swansea City+  West Ham United       2-0  Aston Villa+[Wed Feb/3]+  Everton FC            3-0  Newcastle United++Matchday 25+[Sat Feb/6]+Aston Villa             2-0  Norwich City+Liverpool FC            2-2  Sunderland AFC+Manchester City         1-3  Leicester City+Newcastle United        1-0  West Bromwich Albion+Stoke City              0-3  Everton FC+Swansea City            1-1  Crystal Palace+Tottenham Hotspur       1-0  Watford FC+[Sun Feb/7]+AFC Bournemouth         0-2  Arsenal FC+Chelsea FC              1-1  Manchester United+[Mon Feb/8]+Southampton FC          1-0  West Ham United++Matchday 26+[Sat Feb/13]+AFC Bournemouth         1-3  Stoke City+Chelsea FC              5-1  Newcastle United+Crystal Palace          1-2  Watford FC+Everton FC              0-1  West Bromwich Albion+Norwich City            2-2  West Ham United+Sunderland AFC          2-1  Manchester United+Swansea City            0-1  Southampton FC+[Sun Feb/14]+Arsenal FC              2-1  Leicester City+Aston Villa             0-6  Liverpool FC+Manchester City         1-2  Tottenham Hotspur++Matchday 27+[Sat Feb/27]+Leicester City          1-0  Norwich City+Southampton FC          1-2  Chelsea FC+Stoke City              2-1  Aston Villa+Watford FC              0-0  AFC Bournemouth+West Bromwich Albion    3-2  Crystal Palace+West Ham United         1-0  Sunderland AFC+[Sun Feb/28]+Liverpool FC            4-0  Everton FC      +Manchester United       3-2  Arsenal FC+Newcastle United        1-1  Manchester City     +Tottenham Hotspur       2-1  Swansea City++Matchday 28+[Tue Mar/1]+  AFC Bournemouth       2-0  Southampton FC+  Aston Villa           1-3  Everton FC+  Leicester City        2-2  West Bromwich Albion+  Norwich City          1-2  Chelsea FC+  Sunderland AFC        2-2  Crystal Palace+[Wed Mar/2]+  Arsenal FC            1-2  Swansea City+  Liverpool FC          3-0  Manchester City+  Manchester United     1-0  Watford FC+  Stoke City            1-0  Newcastle United+  West Ham United       1-0  Tottenham Hotspur+  +Matchday 29+[Sat Mar/5]+Chelsea FC              1-1  Stoke City+Everton FC              2-3  West Ham United+Manchester City         4-0  Aston Villa+Newcastle United        1-3  AFC Bournemouth+Southampton FC          1-1  Sunderland AFC+Swansea City            1-0  Norwich City+Tottenham Hotspur       2-2  Arsenal FC+Watford FC              0-1  Leicester City+[Sun Mar/6]+Crystal Palace          1-2  Liverpool FC+West Bromwich Albion    1-0  Manchester United++Matchday 30+[Sat Mar/12]+AFC Bournemouth         3-2  Swansea City+Arsenal FC              2-0  West Bromwich Albion     +Aston Villa             0-2  Tottenham Hotspur+Manchester United       2-0  Crystal Palace   +Norwich City            0-0  Manchester City+Stoke City              1-2  Southampton FC+Sunderland AFC          3-0  Everton FC     +West Ham United         3-1  Watford FC    +[Sun Mar/13]+Liverpool FC            1-1  Chelsea FC       +[Mon Mar/14]+Leicester City          1-0  Newcastle United++Matchday 31+[Sat Mar/19]+Chelsea FC              2-2  West Ham United+Crystal Palace          0-1  Leicester City+Everton FC              0-2  Arsenal FC+Southampton FC          3-2  Liverpool FC+Swansea City            1-0  Aston Villa+Tottenham Hotspur       3-0  AFC Bournemouth+Watford FC              1-2  Stoke City+West Bromwich Albion    0-1  Norwich City+[Sun Mar/20]+Manchester City         0-1  Manchester United+Newcastle United        1-1  Sunderland AFC++Matchday 32+[Sat Apr/2]+AFC Bournemouth         0-4  Manchester City+Arsenal FC              4-0  Watford FC+Aston Villa             0-4  Chelsea FC+Leicester City          1-0  Southampton FC+Liverpool FC            1-1  Tottenham Hotspur+Manchester United       1-0  Everton FC+Norwich City            3-2  Newcastle United+Stoke City              2-2  Swansea City+Sunderland AFC          0-0  West Bromwich Albion+West Ham United         2-2  Crystal Palace++Matchday 33+[Sat Apr/9]+Aston Villa             1-2  AFC Bournemouth+Crystal Palace          1-0  Norwich City+Liverpool FC            4-1  Stoke City+Manchester City         2-1  West Bromwich Albion+Southampton FC          3-1  Newcastle United+Sunderland AFC          0-2  Leicester City+Swansea City            1-0  Chelsea FC+Tottenham Hotspur       3-0  Manchester United+Watford FC              1-1  Everton FC+West Ham United         3-3  Arsenal FC++Matchday 34+[Sat Apr/16]+AFC Bournemouth         1-2  Liverpool FC+Arsenal FC              1-1  Crystal Palace+Chelsea FC              0-3  Manchester City+Everton FC              1-1  Southampton FC+Leicester City          2-2  West Ham United+Manchester United       1-0  Aston Villa+Newcastle United        3-0  Swansea City+Norwich City            0-3  Sunderland AFC+Stoke City              0-4  Tottenham Hotspur+West Bromwich Albion    0-1  Watford FC++Matchday 35+[Sat Apr/23]+AFC Bournemouth         1-4  Chelsea FC+Aston Villa             2-4  Southampton FC+Crystal Palace          0-0  Everton FC+Leicester City          4-0  Swansea City+Liverpool FC            2-2  Newcastle United+Manchester City         4-0  Stoke City+Norwich City            4-2  Watford FC        +Sunderland AFC          0-0  Arsenal FC+Tottenham Hotspur       1-1  West Bromwich Albion+West Ham United         3-2  Manchester United      ++Matchday 36+[Sat Apr/30]+Arsenal FC              1-0  Norwich City+Chelsea FC              2-2  Tottenham Hotspur+Everton FC              2-1  AFC Bournemouth+Manchester United       1-1  Leicester City+Newcastle United        1-0  Crystal Palace+Southampton FC          4-2  Manchester City+Stoke City              1-1  Sunderland AFC+Swansea City            3-1  Liverpool FC+Watford FC              3-2  Aston Villa+West Bromwich Albion    0-3  West Ham United++Leicester erstmals englischer Fussballmeister!++Absteiger  Premiere League: Aston Villa, Newcastle United, Norwich City.+Aufsteiger in Premiere League: Burnley, FC Middlesborough, 1 Platz noch offen. ++Matchday 37+[Sat May/7]+AFC Bournemouth         1-1  West Bromwich Albion+Aston Villa             0-0  Newcastle United+Crystal Palace          2-1  Stoke City+Leicester City          3-1  Everton FC+Liverpool FC            2-0  Watford FC+Manchester City         2-2  Arsenal FC+Norwich City            0-1  Manchester United+Sunderland AFC          3-2  Chelsea FC+Tottenham Hotspur       1-2  Southampton FC+West Ham United         1-4  Swansea City++Matchday 38+[Sun May/15]+Arsenal FC              4-0  Aston Villa+Chelsea FC              1-1  Leicester City+Everton FC              3-0  Norwich City+Manchester United       3-1  AFC Bournemouth       +Newcastle United        5-1  Tottenham Hotspur+Southampton FC          4-1  Crystal Palace+Stoke City              2-1  West Ham United+Swansea City            1-1  Manchester City+Watford FC              2-2  Sunderland AFC+West Bromwich Albion    1-1  Liverpool FC+++Play-Off um 1 Premierleague-Platz:++13.5.16  Sheffield Wednesday  2-0 Brighton&Hove Albion +16.5.16  Brighton&Hove Albion 1-1 Sheffield Wednesday++14.5.16  Derby Country        0-3 Hull City+17.5.16  Hull City            0-2 Derby Country  +++28.5.16  Hull City 1-0 Sheffield Wednesday++3. Aufsteiger in Premierleague:++Hull City.+++Premierleague 2015/16 beendet. ++Premierleague 2016/17 beginnt am 13.08.2016.+++
+ data/league-table.md view
@@ -0,0 +1,11 @@+# Premier League 2015-16: Top 7++Pos|Club                 |Played |Won    |Drawn  |Lost   |GF     |GA     |GD     |Points +---|---------------------|-------|-------|-------|-------|-------|-------|-------|-------+1  |West Ham United      |12     |5      |4      |3      |19     |18     |1      |19     +2  |Tottenham Hotspur    |12     |5      |3      |4      |20     |12     |8      |18     +3  |Leicester City       |12     |4      |6      |2      |17     |16     |1      |18     +4  |Southampton FC       |12     |5      |2      |5      |18     |16     |2      |17     +5  |Arsenal FC           |12     |4      |5      |3      |22     |21     |1      |17     +6  |Manchester United    |12     |4      |4      |4      |12     |16     |-4     |16     +7  |Manchester City      |12     |1      |4      |7      |14     |23     |-9     |7      
examples/TestKit.lhs view
@@ -29,6 +29,8 @@   , cmp   , dumpMacroTable   , sortImports+  , groupSort+  , groupSortBy   , read_file   , write_file   ) where@@ -291,6 +293,37 @@     (hdr,bdy) = span (not . anyMatches . getLineMatches) lns     lns       = grepFilter rex lbs     rex       = [re|^import +(qualified|         ) ${mod}([^ ].*)$|]+\end{code}++++groupSort and groupSortBy+-------------------------++\begin{code}+-- | Sort a list of elements with a stable sort, grouping together the+-- equal elements with the argument grouping function+groupSort :: (Ord a) => (a->[a]->b) -> [a] -> [b]+groupSort = groupSortBy compare++-- | Sort a list of elements with a stable sort, grouping together the+-- equal elements with the argument grouping function.+groupSortBy :: (a->a->Ordering)+            -> (a->[a]->b)+            -> [a]+            -> [b]+groupSortBy comp grp = aggregate . L.sortBy comp+  where+    aggregate []    = []+    aggregate (h:t) = seq g $ g : aggregate rst+      where+        g         = grp h eqs+        (eqs,rst) = span is_le t++        is_le x   = case comp x h of+          LT -> True+          EQ -> True+          GT -> False \end{code}  
examples/re-gen-modules.lhs view
@@ -17,6 +17,7 @@ module Main (main) where  import qualified Data.ByteString.Lazy.Char8               as LBS+import           Data.Monoid import qualified Data.Text                                as T import           Prelude.Compat import           System.Directory@@ -105,10 +106,12 @@  pcre_api_edits :: [(ModPath,SedScript)] pcre_api_edits =-  [ pcre_api_edit "PCRE.ByteString"       "B.ByteString"    "import qualified Data.ByteString               as B"-  , pcre_api_edit "PCRE.ByteString.Lazy"  "LBS.ByteString"  "import qualified Data.ByteString.Lazy          as LBS"-  , pcre_api_edit "PCRE.Sequence"         "(S.Seq Char)"    "import qualified Data.Sequence                 as S"-  , pcre_api_edit "PCRE.String"           "String"          ""+  [ pcre_api_edit "PCRE.ByteString"       "B.ByteString"    "import qualified Data.ByteString               as B"   False+  , pcre_api_edit "PCRE.ByteString.Lazy"  "LBS.ByteString"  "import qualified Data.ByteString.Lazy          as LBS" False+  , pcre_api_edit "PCRE.Sequence"         "(S.Seq Char)"    "import qualified Data.Sequence                 as S"   False+  , pcre_api_edit "PCRE.String"           "String"          ""                                                      False+  , pcre_api_edit "PCRE.Text"             "T.Text"          "import qualified Data.Text                     as T"   True+  , pcre_api_edit "PCRE.Text.Lazy"        "TL.Text"         "import qualified Data.Text.Lazy                as TL"  True   ]  tdfa_api_edit :: ModPath@@ -127,25 +130,33 @@ pcre_api_edit :: ModPath               -> LBS.ByteString               -> LBS.ByteString+              -> Bool               -> (ModPath,SedScript)-pcre_api_edit mp bs_lbs import_lbs =-    (,) fmp $ Pipe+pcre_api_edit mp bs_lbs import_lbs is_orp =+    (,) fmp $ Pipe $         [ Template $ SearchReplace tdfa_re     "PCRE"         , Template $ SearchReplace module_re $ LBS.pack mp         , Template $ SearchReplace import_re   import_lbs         , Template $ SearchReplace bs_re       bs_lbs-        ]+        ] +++        [ Template $ SearchReplace orp_re    $ orphan_import mp+          | is_orp+          ]   where     fmp = "Text.RE." ++ mp  source_api_mp :: ModPath source_api_mp = "Text.RE.TDFA.ByteString.Lazy" -tdfa_re, module_re, import_re, bs_re :: RE+orphan_import :: ModPath -> LBS.ByteString+orphan_import mp = "import           Text.Regex." <> LBS.pack mp <> "()"++tdfa_re, module_re, import_re, bs_re, orp_re :: RE tdfa_re   = [re|TDFA|] module_re = [re|TDFA.ByteString.Lazy|] import_re = [re|import qualified Data.ByteString.Lazy.Char8 *as LBS|] bs_re     = [re|LBS.ByteString|]+orp_re    = [re|^-- NB regex-base instance imports.*$|]   ------------------------------------------------------------------------@@ -206,6 +217,16 @@       , Template [ed|import qualified Data.ByteString.Lazy.Char8    as LBS///|]       , Template [ed|LBS.ByteString///String|]       , Template [ed|Text.RE.ZeInternals.TDFA///Text.RE.ZeInternals.PCRE|]+      ]+  , (,) "Text.RE.ZeInternals.SearchReplace.PCRE.Text" $ pipe+      [ Template [ed|SearchReplace.TDFA.ByteString.Lazy///SearchReplace.PCRE.Text|]+      , Template [ed|Data.ByteString.Lazy.Char8    as LBS///Data.Text                     as T|]+      , Template [ed|LBS.ByteString///T.Text|]+      ]+  , (,) "Text.RE.ZeInternals.SearchReplace.PCRE.Text.Lazy" $ pipe+      [ Template [ed|SearchReplace.TDFA.ByteString.Lazy///SearchReplace.PCRE.Text.Lazy|]+      , Template [ed|Data.ByteString.Lazy.Char8    as LBS///Data.Text.Lazy                as TL|]+      , Template [ed|LBS.ByteString///TL.Text|]       ]   ]   where
examples/re-prep.lhs view
@@ -96,6 +96,7 @@     pd "re-nginx-log-processor"     pd "re-prep"     pd "re-sort-imports"+    pd "re-top"     pd "re-tests"     pd "TestKit"     pd "RE/REOptions"
examples/re-tests.lhs view
@@ -53,6 +53,8 @@ import qualified Text.RE.PCRE.ByteString.Lazy   as PLBS import qualified Text.RE.PCRE.Sequence          as P_SQ import qualified Text.RE.PCRE.String            as P_ST+import qualified Text.RE.PCRE.Text              as P_TX+import qualified Text.RE.PCRE.Text.Lazy         as PLTX import           Text.RE.REOptions import           Text.RE.Replace import           Text.RE.TDFA                   as TDFA@@ -382,7 +384,9 @@     , testg "TDFA.op/LBS"    (TLBS.?=~/) (TLBS.*=~/) tdfa_sr     , testg "PCRE.op/LBS"    (PLBS.?=~/) (PLBS.*=~/) pcre_sr     , testg "TDFA.op/T"      (T_TX.?=~/) (T_TX.*=~/) tdfa_sr+    , testg "PCRE.op/T"      (P_TX.?=~/) (P_TX.*=~/) pcre_sr     , testg "TDFA.op/LT"     (TLTX.?=~/) (TLTX.*=~/) tdfa_sr+    , testg "PCRE.op/LT"     (PLTX.?=~/) (PLTX.*=~/) pcre_sr     , testG "TDFA.op/S"      (T_SQ.?=~/) (T_SQ.*=~/) tdfa_sr     , testG "PCRE.op/S"      (P_SQ.?=~/) (P_SQ.*=~/) pcre_sr     ]@@ -482,6 +486,8 @@     , testCase "PCRE ByteString.Lazy" $ test (PLBS.*=~) (PLBS.?=~) (PLBS.=~) (PLBS.=~~) matchOnce matchMany makeSearchReplace LBS.pack    re_pcre     , testCase "PCRE Sequence"        $ test (P_SQ.*=~) (P_SQ.?=~) (P_SQ.=~) (P_SQ.=~~) matchOnce matchMany makeSearchReplace S.fromList  re_pcre     , testCase "PCRE String"          $ test (P_ST.*=~) (P_ST.?=~) (P_ST.=~) (P_ST.=~~) matchOnce matchMany makeSearchReplace id          re_pcre+    , testCase "PCRE Text"            $ test (P_TX.*=~) (P_TX.?=~) (P_TX.=~) (P_TX.=~~) matchOnce matchMany makeSearchReplace T.pack      re_pcre+    , testCase "PCRE Text.Lazy"       $ test (PLTX.*=~) (PLTX.?=~) (PLTX.=~) (PLTX.=~~) matchOnce matchMany makeSearchReplace LT.pack     re_pcre     , testCase "TDFA a"               $ test (TDFA.*=~) (TDFA.?=~) (TDFA.=~) (TDFA.=~~) matchOnce matchMany makeSearchReplace id          re_tdfa     , testCase "TDFA ByteString"      $ test (T_BS.*=~) (T_BS.?=~) (T_BS.=~) (T_BS.=~~) matchOnce matchMany makeSearchReplace B.pack      re_tdfa     , testCase "TDFA ByteString.Lazy" $ test (TLBS.*=~) (TLBS.?=~) (TLBS.=~) (TLBS.=~~) matchOnce matchMany makeSearchReplace LBS.pack    re_tdfa@@ -699,6 +705,7 @@   , "examples/re-prep.lhs"   , "examples/re-sort-imports.lhs"   , "examples/re-tests.lhs"+  , "examples/re-top.lhs"   , "examples/re-tutorial-options.lhs"   , "examples/re-tutorial-replacing.lhs"   , "examples/re-tutorial-testbench.lhs"
+ examples/re-top.lhs view
@@ -0,0 +1,797 @@+top: Calculating league table variations for the Premier League+===============================================================++This program calculates top-n league tables for the Premier League based+on this [openfootball+data](https://github.com/cdornan/eng-england/tree/corrections).++The program has enough data to self-test but to generate any useful data+you will need to clone [this+repo](git@github.com:cdornan/eng-england.git) into the parent directory+and checkout the 'corrections' branch.++\begin{code}+{-# LANGUAGE NoImplicitPrelude            #-}+{-# LANGUAGE RecordWildCards              #-}+{-# LANGUAGE OverloadedStrings            #-}+{-# LANGUAGE QuasiQuotes                  #-}++module Main(main) where++import qualified Control.Monad         as M+import           Data.Functor.Identity+import qualified Data.HashMap.Lazy     as HML+import qualified Data.List             as L+import           Data.Maybe+import           Data.Monoid+import           Data.Ord+import qualified Data.Text             as T+import qualified Data.Text.IO          as T+import           Data.Time+import           Prelude.Compat+import qualified Shelly                as SH+import           System.Directory+import           System.Environment+import           System.Exit+import           System.FilePath+import           System.IO+import           TestKit+import           Text.RE.Summa+import qualified Text.RE.TDFA         as TDFA+import           Text.RE.TDFA.Text+import           Text.Read+\end{code}+++The CLI parser yields a list of jobs to generate or check various+league tables.++\begin{code}+main :: IO ()+main = parseCLI >>= mapM_ job+\end{code}+++Data Types+----------++A Job contains everything we need to generate a league table, and what+to do with it.++\begin{code}+data Job =+  Job+    { jobTitle  :: T.Text     -- ^ title for the table+    , jobSize   :: Maybe Int  -- ^ a full table or a top-n table+    , jobInputs :: [FilePath] -- ^ the files containing the game data+    , jobIsTest :: Bool       -- ^ are we testing o/p or writing it+    , jobIsHtml :: Bool       -- ^ are we generating HTML from markdown+    , jobOutput :: FilePath   -- ^ where is the output+    }+  deriving (Show)+\end{code}++A match result lists the data in the usual order:++    <home-team> <home-score> <away-score> <away-team>++\begin{code}+data Game = Game Team Int Int Team+  deriving (Eq,Ord,Read,Show)+\end{code}++A league table is a list of teams and their results with the ordering+on everything is arranged so that the list can be sorted with the+default `Ord` ordering to arrange the table according to PL conventions.++\begin{code}+newtype Table = Table { getTable :: [(Results,Team)] }+  deriving (Show)+\end{code}++Teams are just Text containing the names used by the openfootball data.++\begin{code}+type Team = T.Text+\end{code}++Results contain everything we need to generate a league table.++\begin{code}+data Results =+  Results+    { resultsGamesPlayed  :: Int+    , resultsGamesWon     :: Int+    , resultsGoalsFor     :: Int+    , resultsGoalsAgainst :: Int+    , resultsPointsScored :: Int+    }+  deriving (Show)+\end{code}++These vectors have expected zeros and sums.++\begin{code}+instance Monoid Results where+  mempty  = Results 0 0 0 0 0+  mappend (Results gp1 gw1 gf1 ga1 ps1)+          (Results gp2 gw2 gf2 ga2 ps2) =+      Results (gp1+gp2)+              (gw1+gw2)+              (gf1+gf2)+              (ga1+ga2)+              (ps1+ps2)+\end{code}++PL results are ordered by (points,goal-difference,goals-scored).++\begin{code}+instance Ord Results where+  compare = comparing $ \Results{..} ->+      ( resultsPointsScored+      , resultsGoalsFor - resultsGoalsAgainst+      , resultsGoalsFor+      )++instance Eq Results where+  (==) x y = compare x y == EQ+\end{code}+++Executing Jobs+--------------++\begin{code}+job :: Job -> IO ()+job jb = top jb <$> input jb >>= output jb+\end{code}++Compute a Table from Game data according to the jobSize parameter.+\begin{code}+top :: Job -> [Game] -> Table+top Job{..} mtchs = case jobSize of+    Nothing -> full_tbl+    Just n  -> aggregate $+      filterGames (topTeams n full_tbl) mtchs+  where+    full_tbl = aggregate mtchs+\end{code}++Calculate the top n teams in a table.++\begin{code}+topTeams :: Int -> Table -> [Team]+topTeams n = map snd . take n . getTable+\end{code}++Filter game data to only include games between the listed teams.++\begin{code}+filterGames :: [Team] -> [Game] -> [Game]+filterGames tms = filter $ \(Game h _ _ a) ->+    h `elem` tms && a `elem` tms+\end{code}++Aggregate game data into a table.++\begin{code}+aggregate :: [Game] -> Table+aggregate mtchs = sortResults $+    map homeResults mtchs ++ map awayResults mtchs+\end{code}++Generate the results for the home team from a Game result.++\begin{code}+homeResults :: Game -> (Results,Team)+homeResults (Game h hs as _) = flip (,) h+    Results+      { resultsGamesPlayed  = 1+      , resultsGamesWon     = wins   $ hs - as+      , resultsGoalsFor     = hs+      , resultsGoalsAgainst = as+      , resultsPointsScored = points $ hs - as+      }+\end{code}++Generate the results for the away team from a Game result.++\begin{code}+awayResults :: Game -> (Results,Team)+awayResults (Game _ hs as a) = flip (,) a+    Results+      { resultsGamesPlayed  = 1+      , resultsGamesWon     = wins   $ as - hs+      , resultsGoalsFor     = as+      , resultsGoalsAgainst = hs+      , resultsPointsScored = points $ as - hs+      }+\end{code}++Calculate the points accruing to a team from their goal difference+for a game.++\begin{code}+points :: Int -> Int+points gd = case compare gd 0 of+  LT -> 0+  EQ -> 1+  GT -> 3+\end{code}++Calculate the number of wins accruing to a team (0 or 1) from their goal+for a game.++\begin{code}+wins :: Int -> Int+wins gd = case gd>0 of+  True  -> 1+  False -> 0+\end{code}++Collate a list of results into a table.++\begin{code}+sortResults :: [(Results,Team)] -> Table+sortResults =+    Table+      . L.sortBy (flip $ comparing fst)+      . groupSortBy (comparing snd) grp+  where+    grp (r,t) ps = (r',t)+      where+        r' = mconcat $ r : map fst ps+\end{code}+++input+-----++Parse openfootball data into Game data, eliminating duplicate results.+(For `g1` and `g2` to be recognised as a duplicate, it must be true that+`g1==g2`.)++\begin{code}+input :: Job -> IO [Game]+input Job{..} =+  groupSort const . parseGames . T.concat <$> mapM T.readFile jobInputs+\end{code}+++parseGames+----------++The Game parser has three variants that should all be equivalent.++\begin{code}+parseGames :: T.Text -> [Game]+parseGames = case PrimParseGames of+  SimpleParseGames -> simpleParseGames+  FunParseGames    -> funParseGames+  PrimParseGames   -> primParseGames++data ParseGames = SimpleParseGames | FunParseGames | PrimParseGames+\end{code}+++<h3>simpleParseGames</h3>++Here we apply the `gameEdit` `SearchReplace` editor to:++  1. recognise the lines that contain the match results data and++  2. transform the lines into Haskell `Game` format which can be+     parsed by `readText`.++The `edit` function is a simple specialisation of the `regex` `sed'`+function (defined below) that deletes every line in the file that edits+every line in the file according to the given `SearchReplace`, deleting+all other lies.+++\begin{code}+simpleParseGames :: T.Text -> [Game]+simpleParseGames = map readText . T.lines . edit gameEdit+\end{code}++The `[ed|` ... `///` ... `|]` `SearchReplace` editors for recognizing+line containing matchresults and converting them to Haskell-format+`Game` data come in two variants that should be equivalent.++\begin{code}+gameEdit :: SearchReplace RE T.Text+gameEdit = case MacrosGameEdit of+  SimpleGameEdit -> simpleGameEdit+  MacrosGameEdit -> macrosGameEdit++data GameEdit = SimpleGameEdit | MacrosGameEdit+\end{code}+++<h4>simpleGameEdit</h4>++\begin{code}+simpleGameEdit :: SearchReplace RE T.Text+simpleGameEdit =+  [ed|^ *${ht}([A-Za-z][a-zA-Z ]*[A-Za-z]) +${hs}([0-9]+)-${as}([0-9]+) +(\([^)]+\) *)?${at}([A-Za-z][a-zA-Z ]*[A-Za-z]) *(@.*)?$///Game "${ht}" ${hs} ${as} "${at}"|]+\end{code}+++<h4>simpleGameEdit</h4>++\begin{code}+macrosGameEdit :: SearchReplace RE T.Text+macrosGameEdit =+  [ed_|^ *${ht}(@{team}) +${hs}([0-9]+)-${as}([0-9]+) +(\([0-9]+-[0-9]+\) *)?${at}(@{team}) *(@.*)?$///Game "${ht}" ${hs} ${as} "${at}"|] macs+\end{code}++\begin{code}+macs :: Macros RE+macs = makeMacros env++env :: MacroEnv+env = makeEnv [(,) "team" teamMacro] TDFA.preludeEnv+\end{code}++\begin{code}+teamMacro :: MacroEnv -> MacroID -> MacroDescriptor+teamMacro ev mid =+  runTests TDFA.regexType Just (map dup samples) ev mid+    MacroDescriptor+      { macroSource          = RegexSource "([a-zA-Z]+ ?)*[A-Za-z]" -- the RE to be substituted for the macro+      , macroSamples         = samples                              -- list of strings that should match the above macro RE+      , macroCounterSamples  = counter_samples                      -- list of strings that should **not** match the above macro RE+      , macroTestResults     = []                                   -- for bookkeeping+      , macroParser          = Nothing                              -- no parser needed for this one!+      , macroDescription     = "team names: alphabetic characters interspersed with spaces"+      }+  where+    samples =+        [ "Chelsea FC"+        , "West Bromwich Albion"+        , "AFC Bournemouth"+        , "F"+        , "AB"+        , "A B"+        , "AA B"+        ]++    counter_samples =+        [ "Arsenal FC "+        , " Liverpool FC"+        , "West Bromwich  Albion"+        , "F2"+        , ""+        ]++    dup x = (x,x)+\end{code}++\begin{code}+listMacros :: IO ()+listMacros = do+    hPutStr stderr $ formatMacroTable TDFA.regexType env+    ok <- testMacroEnv "macros" TDFA.regexType env+    M.when (not ok) $ exitWith $ ExitFailure 1+\end{code}+++<h3>funParseGames</h3>++Here we use the `regex` `grepFilter` to extract all of the lines that+match our `rex` RE for detecting match-result data and assemble the+`Game` data directly by extracting the `ht`, `hs`, `as` and `at`+fields from the matched result.++\begin{code}+funParseGames :: T.Text -> [Game]+funParseGames txt =+    [ Game (           mtch !$$ [cp|ht|])+           (readText $ mtch !$$ [cp|hs|])+           (readText $ mtch !$$ [cp|as|])+           (           mtch !$$ [cp|at|])+        | Line{..} <- grepFilter rex txt+        , [mtch]   <- [allMatches getLineMatches]+        ]+\end{code}++The RE for merely recognising lines that contain match results in the+input data come in two variants. We either extract the RE from the above+`SearchReplace` template or rebuild the `[re|` ... `]`. (They should of+course be equivalent.)++\begin{code}+rex :: RE+rex = case Direct of+  Direct  ->+    [re_|^ *${ht}(@{team}) +${hs}([0-9]+)-${as}([0-9]+) +(\([0-9]+-[0-9]+\) *)?${at}(@{team}) *(@.*)?$|] macs+  Recycle ->+    getSearch gameEdit++data REX = Direct | Recycle+\end{code}+++<h3>primParseGames</h3>++This variant of `funParseGames` uses `T.lines` and `?=~` instead of+`grepFilter`.++\begin{code}+primParseGames :: T.Text -> [Game]+primParseGames txt =+    [ Game (           mtch !$$ [cp|ht|])+           (readText $ mtch !$$ [cp|hs|])+           (readText $ mtch !$$ [cp|as|])+           (           mtch !$$ [cp|at|])+        | mtch <- map (?=~ rex) $ T.lines txt+        , matched mtch+        ]+\end{code}+++output+------++Write out/test the Table according to the Job output parameters.++\begin{code}+output :: Job -> Table -> IO ()+output jb@Job{..} tbl = case jobIsTest of+    True  -> test_it =<< formatTable jb tbl+    False -> case jobOutput of+      "-" -> T.putStr       =<< formatTable jb tbl+      fp  -> T.writeFile fp =<< formatTable jb tbl+  where+    test_it txt = do+      txt' <- T.readFile jobOutput+      case txt == txt' of+        True  -> putStrLn "OK"+        False -> do+          putStrLn "Test Failed"+          exitWith $ ExitFailure 1+\end{code}++Generate the markdown for a table and optionally use Pandoc to generate+the Html.++\begin{code}+formatTable :: Job -> Table -> IO T.Text+formatTable Job{..} (Table ps) = to_html $ T.unlines $+    [ "# " <> jobTitle+    , ""+    , mk_row header_row+    , mk_row divider_row+    ] ++ map mk_row (zipWith gen_row [1..] ps)+  where+    divider_row = map (T.map (const '-')) header_row+    header_row  = map column_header [minBound..maxBound]++    mk_row :: [T.Text] -> T.Text+    mk_row = T.intercalate "|"++    gen_row :: Int -> (Results,Team) -> [T.Text]+    gen_row i (r,t) = map (gen_field i t r) [minBound..maxBound]++    gen_field :: Int -> Team -> Results -> Col -> T.Text+    gen_field i tm Results{..} col = lj $ case col of+        Position  -> showText i+        Club      -> tm+        Played    -> showText   resultsGamesPlayed+        Won       -> showText   resultsGamesWon+        Drawn     -> showText   games_drawn+        Lost      -> showText $ resultsGamesPlayed -+                            (resultsGamesWon + games_drawn)+        GF        -> showText   resultsGoalsFor+        GA        -> showText   resultsGoalsAgainst+        GD        -> showText $ resultsGoalsFor -+                                        resultsGoalsAgainst+        Points    -> showText   resultsPointsScored+      where+        lj = T.justifyLeft wd ' '+        wd = T.length $ column_header col++        games_drawn = resultsPointsScored - win_points+        win_points  = resultsGamesWon * 3++    to_html = case jobIsHtml of+      True  -> pandoc jobTitle+      False -> return++data Col+  = Position+  | Club+  | Played+  | Won+  | Drawn+  | Lost+  | GF+  | GA+  | GD+  | Points+  deriving (Bounded,Enum,Show)++column_header :: Col -> T.Text+column_header col = case col of+  Position  -> "Pos"+  Club      -> "Club                 "+  _         -> T.justifyLeft 7 ' ' $ showText col+\end{code}+++parseCLI+--------++The command line parser generates a list of league-table+generating/testing jobs for execution by the above `job`+action. Non-league-table-generating CLI commands like+`macros` for listing our RE table macros just do their+thing and return an empty list of jobs.++\begin{code}+parseCLI :: IO [Job]+parseCLI = do+  args <- getArgs+  case args of+    []                 -> listMacros  >> testJob      -- test with canned vectors+    ["test"]           -> listMacros  >> testJob      --    "+    ["setup-test"]     ->                setupTestJob -- setup the test data, generating the golden data+    ["update"]         -> updateIndex >> updateJobs   -- update the website with latest data+    ["table",pth]      -> discover pth   Nothing      -- write out a full league table+    ["table",pth,sz_s]+      | Just sz <- readMaybe sz_s+                       -> discover pth $ Just sz      -- write out a bounded league table+    ["macros"]         -> listMacros  >> return []    -- list the RE macros we are using to parse the data+    _                  -> do                          -- generate the usage message and fail+        pn <- getProgName+        hPutStr stderr $ prog pn+          [ "[test]"+          , "setup-test"+          , "update"+          , "table   <path> [<size>]"+          ]+        exitWith $ ExitFailure 1+  where+    prog pn as = unlines $ zipWith prog_ (pn : repeat pn') as+      where+        pn'       = map (const ' ') pn++        prog_ p a = unwords [p,a]++testJob, setupTestJob :: IO [Job]+testJob      = testJob_ True+setupTestJob = testJob_ False++testJob_ :: Bool -> IO [Job]+testJob_ is_t = do+  createDirectoryIfMissing True "data"+  return+    [ Job+        { jobTitle  = "Premier League 2015-16: Top 7"+        , jobSize   = Just 7+        , jobInputs =+            [ "data/2015-16-premierleague.txt"+            ]+        , jobIsTest = is_t+        , jobIsHtml = False+        , jobOutput = "data/league-table.md"+        }+    ]++updateJobs :: IO [Job]+updateJobs = do+    dy <- utctDay <$> getCurrentTime+    return $ concat $ map (mk dy) updateJobSpecs+  where+    mk dy js@JobSpec{..} =+        [ Job+            { jobTitle  = T.unwords $+                [ "Premier League " <> T.pack jsSeason+                , maybe "" (\n->"Top "<>showText n<>" ") jsSize+                , "["<>showText dy<>"]"+                ]+            , jobSize   = jsSize+            , jobInputs =+                [ mkPath jsSeason "1-premierleague-i.txt"+                , mkPath jsSeason "1-premierleague-ii.txt"+                ]+            , jobIsTest = False+            , jobIsHtml = is_html+            , jobOutput = leagueTablesDir </> tableFile js is_html+            }+        | is_html <- [True,False]+        ]++updateIndex :: IO ()+updateIndex = pandoc title toc >>= T.writeFile index_file+  where+    toc = T.unlines $+      [ "# " <> title+      , ""+      , mk_row ["Season", "Top-N", "Html", "Text"]+      , mk_row ["------", "-----", "----", "----"]+      ] +++      [ mk_row+          [ T.pack jsSeason+          , maybe "all" showText jsSize+          , lk "HTML" $ T.pack $ tableFile js True+          , lk "Text" $ T.pack $ tableFile js False+          ]+        | js@JobSpec{..} <- updateJobSpecs+        ]++    title      = "The League Tables"+    index_file = leagueTablesDir </> "index.html"++    mk_row     = T.intercalate "|"++    lk lab url = "["<>lab<>"]("<>url<>")"++tableFile :: JobSpec -> Bool -> FilePath+tableFile JobSpec{..} is_html = jsSeason ++ "-" ++ sze <.> ext+  where+    sze = maybe "all" (("top-"++).show) jsSize+    ext = if is_html then "html" else "txt"++leagueTablesDir :: FilePath+leagueTablesDir = "docs/league-tables"++updateJobSpecs :: [JobSpec]+updateJobSpecs =+  [ JobSpec sn mb+    | sn <- ["2016-17","2015-16"]+    , mb <- Nothing : map Just [6..10]+    ]++data JobSpec =+  JobSpec+    { jsSeason :: String+    , jsSize   :: Maybe Int+    }+  deriving (Show)++discover :: FilePath -> Maybe Int -> IO [Job]+discover fp mb = do+  inps <- dscvr candidates+  return+    [ Job+        { jobTitle  = maybe fp_t mk_ttl $+              matchedText $ fp_t ?=~ [re|[0-9]{4}-[0-9]{2}|]+        , jobSize   = mb+        , jobInputs = inps+        , jobIsTest = False+        , jobIsHtml = False+        , jobOutput = "-"+        }+    ]+  where+    fp_t            = T.pack fp++    mk_ttl ssn      = "Premier League " <> ssn++    dscvr []        = error $ fp ++ ": no data found"+    dscvr (fps:cds) = do+      ok <- and <$> mapM doesFileExist fps+      case ok of+        True  -> return fps+        False -> dscvr cds++    candidates =+      [ [ fp+        ]+      , [ data_dir </> fp </> "1-premierleague.txt"+        ]+      , [ data_dir </> fp </> "1-premierleague-i.txt"+        , data_dir </> fp </> "1-premierleague-ii.txt"+        ]+      ]++mkPath :: String -> String -> FilePath+mkPath ssn hlf = data_dir </> ssn </> hlf++data_dir :: FilePath+data_dir = "../eng-england"+\end{code}+++Pandoc+------++Use Pandoc to generate a an Html file from a title and markdown text.++\begin{code}+pandoc :: T.Text -> T.Text -> IO T.Text+pandoc title txt = do+    T.writeFile inp_file   txt+    T.writeFile mda_file $ T.unlines+          [ "---"+          , "title: "<>title+          , "---"+          ]+    fmap (const ()) $+      SH.shelly $ SH.verbosely $+        SH.run "pandoc"+          [ "-f", "markdown+grid_tables"+          , "-t", "html5"+          , "-T", "regex"+          , "-s"+          , "-c", "bs.css"+          , "-c", "styles.css"+          , "-c", "tabular.css"+          , "-o", T.pack out_file+          , T.pack mda_file+          , T.pack inp_file+          ]+    T.readFile out_file+  where+    mda_file = "tmp/metadata.markdown"+    inp_file = "tmp/pandoc-inp.md"+    out_file = "tmp/pandoc-out.html"+\end{code}+++Helpers+-------++The general helpers.++<h3>edit</h3>++The `edit` function is a simple specialisation of the `regex`+`sed'` function (defined below) that deletes every line in the file+that edits every line in the file according to the given `SearchReplace`+template, deleting all other lines. (It should probably be added to+regex.)++\begin{code}+edit :: SearchReplace RE T.Text -> T.Text -> T.Text+edit sr txt = runIdentity $ flip sed' txt $+    Select+      [ Template sr+      , LineEdit [re|.*|] $ \_ _ -> return Delete+      ]+\end{code}++<h3>makeMacros and makeEnv</h3>++Construct a Macros table for compiling REs from a MacroEnv. (Something+similar  should probably be added to regex.)++\begin{code}+makeMacros :: MacroEnv -> Macros RE+makeMacros ev = runIdentity $+    mkMacros mk TDFA.regexType ExclCaptures ev+  where+    mk   = maybe oops Identity .+                TDFA.compileRegexWithOptions TDFA.noPreludeREOptions++    oops = error "makeMacros: unexpected RE compilation error"+\end{code}++Construct a a `MacroEnv` from an association list of `MacroId` and+`MacroDescriptior` constructor functions and the base `MacroEnv`+(the macros that can be used inside the macros). (Something+similar  should probably be added to regex.)++\begin{code}+makeEnv :: [(MacroID,MacroEnv -> MacroID -> MacroDescriptor)]+        -> MacroEnv+        -> MacroEnv+makeEnv al ev0 = ev+  where+    ev = ev0 `HML.union` HML.fromList+                  [ (mid, mk ev mid) | (mid,mk) <- al ]+\end{code}+++<h3>showText and readText</h3>++Variants of the standard functions that operate over `Text`.++\begin{code}+showText :: Show a => a -> T.Text+showText = T.pack . show++readText :: Read a => T.Text -> a+readText = fromMaybe (error "readText") . readMaybe . T.unpack+\end{code}
examples/re-tutorial-tools.lhs view
@@ -155,7 +155,7 @@ position of the first import statement in the module, where each import statement is in a standard form matched by the regex ```haskell-[re|^import +(qualified )? *${mod}([^ ].*)$|]+[re|^import +(qualified|         ) ${mod}([^ ].*)$|] ```  We have reproduced `sortImports` under the name `sortImports_` here.
lib/cabal-masters/constraints-incl.cabal view
@@ -1,26 +1,31 @@ %-    regex                   == <<$version$>> %-    regex-with-pcre         == <<$version$>>-%-    array                   >= 0.4-%-    base                    >= 4 && < 5-%-    base-compat             >= 0.6.0-%-    bytestring              >= 0.10.2.0-%-    containers              >= 0.4+%-    array                   >= 0.4      && < 0.6+%-    base                    >= 4        && < 5+%-    base-compat             >= 0.6      && < 0.10+%-    blaze-html              >= 0.8.1.0+%-    bytestring              == 0.10.*+%-    containers              >= 0.4      && < 0.6+%-    data-default            >= 0.5.3 %-    directory               >= 1.2.1.0-%-    hashable                >= 1.2.3.3+%-    filepath                >= 1.3.0.2+%-    hashable                == 1.2.* %-    heredoc                 >= 0.2.0.0 %-    http-conduit            >= 2.1.7.2-%-    regex-base              >= 0.93.2-%-    regex-pcre-builtin      >= 0.94.4.8.8.35-%-    regex-tdfa              >= 1.2.0-%-    regex-tdfa-text         >= 1.0.0.3+%-    pandoc                  >= 1.13.2.1+%-    regex-base              == 0.93.*+%-    regex-pcre-builtin      == 0.94.*+%-    regex-tdfa              == 1.2.*+%-    regex-tdfa-text         == 1.0.*+%-    regex-pcre-text         == 0.94.* %-    shelly                  >= 1.6.1.2 %-    smallcheck              >= 1.1.1 %-    tasty                   >= 0.10.1.2 %-    tasty-hunit             >= 0.9.2 %-    tasty-smallcheck        >= 0.8.0.1-%-    template-haskell        >= 2.7-%-    text                    >= 1.2.0.6-%-    time                    >= 1.4.2-%-    time-locale-compat      >= 0.1.0.1-%-    transformers            >= 0.2.2-%-    unordered-containers    >= 0.2.5.1+%-    template-haskell        >= 2.7      && < 2.12+%-    text                    == 1.2.*+%-    time                    >= 1.4.2    && < 1.9+%-    time-locale-compat      == 0.1.*+%-    transformers            >= 0.2.2    && < 0.6+%-    unordered-containers    == 0.2.*
lib/cabal-masters/executables-incl.cabal view
@@ -68,6 +68,16 @@  %build-depends-prog regex regex-with-pcre array base base-compat bytestring containers directory filepath heredoc regex-base regex-tdfa regex-tdfa-text regex-pcre-builtin shelly smallcheck tasty tasty-hunit tasty-smallcheck template-haskell text unordered-containers +%test-exe re-top+    Hs-Source-Dirs:     examples++    Main-Is:            re-top.lhs++    Other-Modules:+      TestKit++%build-depends-prog regex base base-compat blaze-html bytestring data-default directory filepath shelly text time time-locale-compat transformers unordered-containers+ %test-exe re-tutorial     Hs-Source-Dirs:     examples 
lib/cabal-masters/library-incl.cabal view
@@ -7,6 +7,8 @@       Text.RE.PCRE.ByteString.Lazy       Text.RE.PCRE.Sequence       Text.RE.PCRE.String+      Text.RE.PCRE.Text+      Text.RE.PCRE.Text.Lazy       Text.RE.REOptions       Text.RE.Replace       Text.RE.Summa@@ -42,6 +44,8 @@       Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy       Text.RE.ZeInternals.SearchReplace.PCRE.Sequence       Text.RE.ZeInternals.SearchReplace.PCRE.String+      Text.RE.ZeInternals.SearchReplace.PCRE.Text+      Text.RE.ZeInternals.SearchReplace.PCRE.Text.Lazy       Text.RE.ZeInternals.SearchReplace.PCREEdPrime       Text.RE.ZeInternals.SearchReplace.TDFA       Text.RE.ZeInternals.SearchReplace.TDFA.ByteString
lib/cabal-masters/mega-regex.cabal view
@@ -38,7 +38,7 @@  %include "lib/cabal-masters/library-incl.cabal" -%build-depends-lib array bytestring base base-compat containers hashable regex-base regex-tdfa regex-tdfa-text regex-pcre-builtin template-haskell text time time-locale-compat transformers unordered-containers+%build-depends-lib array bytestring base base-compat containers hashable regex-base regex-tdfa regex-tdfa-text regex-pcre-builtin regex-pcre-text template-haskell text time time-locale-compat transformers unordered-containers  %include "lib/cabal-masters/executables-incl.cabal" 
lib/cabal-masters/test-extra-source-files-incl.cabal view
@@ -1,11 +1,13 @@ Extra-Source-Files:     README.markdown     changelog+    data/2015-16-premierleague.txt     data/access-errors.log     data/access.log     data/error.log     data/events.log     data/include-result.lhs+    data/league-table.md     data/pp-result-doc.lhs     data/pp-result-gen.lhs     data/pp-test.lhs@@ -25,6 +27,8 @@     src/Text/RE/PCRE/ByteString/Lazy.hs     src/Text/RE/PCRE/Sequence.hs     src/Text/RE/PCRE/String.hs+    src/Text/RE/PCRE/Text.hs+    src/Text/RE/PCRE/Text/Lazy.hs     src/Text/RE/TDFA/ByteString.hs     src/Text/RE/TDFA/ByteString/Lazy.hs     src/Text/RE/TDFA/Sequence.hs
lib/mega-regex.cabal view
@@ -1,5 +1,5 @@ Name:                   regex-Version:                1.0.0.0+Version:                1.0.1.0 Synopsis:               Toolkit for regex-base Description:            A regular expression toolkit for regex-base with                         compile-time checking of RE syntax, data types for@@ -22,11 +22,13 @@ Extra-Source-Files:     README.markdown     changelog+    data/2015-16-premierleague.txt     data/access-errors.log     data/access.log     data/error.log     data/events.log     data/include-result.lhs+    data/league-table.md     data/pp-result-doc.lhs     data/pp-result-gen.lhs     data/pp-test.lhs@@ -46,6 +48,8 @@     src/Text/RE/PCRE/ByteString/Lazy.hs     src/Text/RE/PCRE/Sequence.hs     src/Text/RE/PCRE/String.hs+    src/Text/RE/PCRE/Text.hs+    src/Text/RE/PCRE/Text/Lazy.hs     src/Text/RE/TDFA/ByteString.hs     src/Text/RE/TDFA/ByteString/Lazy.hs     src/Text/RE/TDFA/Sequence.hs@@ -64,7 +68,7 @@ Source-Repository this     Type:               git     Location:           https://github.com/iconnect/regex.git-    Tag:                1.0.0.0+    Tag:                1.0.1.0   @@ -77,6 +81,8 @@       Text.RE.PCRE.ByteString.Lazy       Text.RE.PCRE.Sequence       Text.RE.PCRE.String+      Text.RE.PCRE.Text+      Text.RE.PCRE.Text.Lazy       Text.RE.REOptions       Text.RE.Replace       Text.RE.Summa@@ -112,6 +118,8 @@       Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy       Text.RE.ZeInternals.SearchReplace.PCRE.Sequence       Text.RE.ZeInternals.SearchReplace.PCRE.String+      Text.RE.ZeInternals.SearchReplace.PCRE.Text+      Text.RE.ZeInternals.SearchReplace.PCRE.Text.Lazy       Text.RE.ZeInternals.SearchReplace.PCREEdPrime       Text.RE.ZeInternals.SearchReplace.TDFA       Text.RE.ZeInternals.SearchReplace.TDFA.ByteString@@ -167,22 +175,23 @@       -Werror      Build-depends:-        array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4-      , hashable             >= 1.2.3.3-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+        array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6+      , hashable             == 1.2.*+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-pcre-text      == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   Executable re-gen-cabals@@ -201,17 +210,17 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , regex-base           >= 0.93.2-      , regex-tdfa           >= 1.2.0+      , regex-base           == 0.93.*+      , regex-tdfa           == 1.2.*       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   Test-Suite re-gen-cabals-test@@ -231,17 +240,17 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , regex-base           >= 0.93.2-      , regex-tdfa           >= 1.2.0+      , regex-base           == 0.93.*+      , regex-tdfa           == 1.2.*       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   @@ -261,16 +270,16 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0-      , regex-base           >= 0.93.2-      , regex-tdfa           >= 1.2.0+      , regex-base           == 0.93.*+      , regex-tdfa           == 1.2.*       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   Test-Suite re-gen-modules-test@@ -290,16 +299,16 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0-      , regex-base           >= 0.93.2-      , regex-tdfa           >= 1.2.0+      , regex-base           == 0.93.*+      , regex-tdfa           == 1.2.*       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   @@ -319,13 +328,13 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   Test-Suite re-include-test@@ -345,13 +354,13 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   @@ -371,21 +380,21 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0-      , filepath             -      , regex-base           >= 0.93.2-      , regex-tdfa           >= 1.2.0+      , filepath             >= 1.3.0.2+      , regex-base           == 0.93.*+      , regex-tdfa           == 1.2.*       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   Test-Suite re-nginx-log-processor-test@@ -405,21 +414,21 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0-      , filepath             -      , regex-base           >= 0.93.2-      , regex-tdfa           >= 1.2.0+      , filepath             >= 1.3.0.2+      , regex-base           == 0.93.*+      , regex-tdfa           == 1.2.*       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   @@ -439,16 +448,16 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0-      , filepath             +      , filepath             >= 1.3.0.2       , heredoc              >= 0.2.0.0       , http-conduit         >= 2.1.7.2       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   Test-Suite re-prep-test@@ -468,16 +477,16 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0-      , filepath             +      , filepath             >= 1.3.0.2       , heredoc              >= 0.2.0.0       , http-conduit         >= 2.1.7.2       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   @@ -497,14 +506,14 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0-      , filepath             +      , filepath             >= 1.3.0.2       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   Test-Suite re-sort-imports-test@@ -524,14 +533,14 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0-      , filepath             +      , filepath             >= 1.3.0.2       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   @@ -551,27 +560,27 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , filepath             +      , filepath             >= 1.3.0.2       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , unordered-containers == 0.2.*   Test-Suite re-tests-test@@ -591,30 +600,96 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , filepath             +      , filepath             >= 1.3.0.2       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , unordered-containers == 0.2.*   +Executable re-top+    Hs-Source-Dirs:     examples++    Main-Is:            re-top.lhs++    Other-Modules:+      TestKit++    Default-Language:   Haskell2010++    GHC-Options:+      -Wall+      -fwarn-tabs+      -Werror++    Build-depends:+        regex                == 1.0.1.0+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , blaze-html           >= 0.8.1.0+      , bytestring           == 0.10.*+      , data-default         >= 0.5.3+      , directory            >= 1.2.1.0+      , filepath             >= 1.3.0.2+      , shelly               >= 1.6.1.2+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*+++Test-Suite re-top-test+    type:               exitcode-stdio-1.0+    Hs-Source-Dirs:     examples++    Main-Is:            re-top.lhs++    Other-Modules:+      TestKit++    Default-Language:   Haskell2010++    GHC-Options:+      -Wall+      -fwarn-tabs+      -Werror++    Build-depends:+        regex                == 1.0.1.0+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , blaze-html           >= 0.8.1.0+      , bytestring           == 0.10.*+      , data-default         >= 0.5.3+      , directory            >= 1.2.1.0+      , filepath             >= 1.3.0.2+      , shelly               >= 1.6.1.2+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*+++ Executable re-tutorial     Hs-Source-Dirs:     examples @@ -632,30 +707,30 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   Test-Suite re-tutorial-test@@ -676,30 +751,30 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   @@ -722,30 +797,30 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   @@ -766,30 +841,30 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   Test-Suite re-tutorial-options-test@@ -810,30 +885,30 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   @@ -854,30 +929,30 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   Test-Suite re-tutorial-replacing-test@@ -898,30 +973,30 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   @@ -942,30 +1017,30 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   Test-Suite re-tutorial-testbench-test@@ -986,30 +1061,30 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   @@ -1030,30 +1105,30 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   @@ -1075,30 +1150,30 @@       -Werror      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   
lib/version.txt view
@@ -1,1 +1,1 @@-1.0.0.0+1.0.1.0
regex-examples.cabal view
@@ -1,5 +1,5 @@ Name:                   regex-examples-Version:                1.0.0.0+Version:                1.0.1.0 Synopsis:               Tutorial, tests and example programs for regex Description:            Tutorial, tests and example programs for regex,                         a Regular Expression Toolkit for regex-base with@@ -22,11 +22,13 @@ Extra-Source-Files:     README.markdown     changelog+    data/2015-16-premierleague.txt     data/access-errors.log     data/access.log     data/error.log     data/events.log     data/include-result.lhs+    data/league-table.md     data/pp-result-doc.lhs     data/pp-result-gen.lhs     data/pp-test.lhs@@ -46,6 +48,8 @@     src/Text/RE/PCRE/ByteString/Lazy.hs     src/Text/RE/PCRE/Sequence.hs     src/Text/RE/PCRE/String.hs+    src/Text/RE/PCRE/Text.hs+    src/Text/RE/PCRE/Text/Lazy.hs     src/Text/RE/TDFA/ByteString.hs     src/Text/RE/TDFA/ByteString/Lazy.hs     src/Text/RE/TDFA/Sequence.hs@@ -64,7 +68,7 @@ Source-Repository this     Type:               git     Location:           https://github.com/iconnect/regex.git-    Tag:                1.0.0.0+    Tag:                1.0.1.0   Executable re-gen-cabals@@ -83,17 +87,17 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , regex-base           >= 0.93.2-      , regex-tdfa           >= 1.2.0+      , regex-base           == 0.93.*+      , regex-tdfa           == 1.2.*       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   Test-Suite re-gen-cabals-test@@ -113,17 +117,17 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , regex-base           >= 0.93.2-      , regex-tdfa           >= 1.2.0+      , regex-base           == 0.93.*+      , regex-tdfa           == 1.2.*       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   @@ -143,16 +147,16 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0-      , regex-base           >= 0.93.2-      , regex-tdfa           >= 1.2.0+      , regex-base           == 0.93.*+      , regex-tdfa           == 1.2.*       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   Test-Suite re-gen-modules-test@@ -172,16 +176,16 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0-      , regex-base           >= 0.93.2-      , regex-tdfa           >= 1.2.0+      , regex-base           == 0.93.*+      , regex-tdfa           == 1.2.*       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   @@ -201,13 +205,13 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   Test-Suite re-include-test@@ -227,13 +231,13 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   @@ -253,22 +257,22 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , regex-with-pcre      == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , regex-with-pcre      == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0-      , filepath             -      , regex-base           >= 0.93.2-      , regex-tdfa           >= 1.2.0+      , filepath             >= 1.3.0.2+      , regex-base           == 0.93.*+      , regex-tdfa           == 1.2.*       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   Test-Suite re-nginx-log-processor-test@@ -288,22 +292,22 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , regex-with-pcre      == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , regex-with-pcre      == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0-      , filepath             -      , regex-base           >= 0.93.2-      , regex-tdfa           >= 1.2.0+      , filepath             >= 1.3.0.2+      , regex-base           == 0.93.*+      , regex-tdfa           == 1.2.*       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   @@ -323,16 +327,16 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0-      , filepath             +      , filepath             >= 1.3.0.2       , heredoc              >= 0.2.0.0       , http-conduit         >= 2.1.7.2       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   Test-Suite re-prep-test@@ -352,16 +356,16 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0-      , filepath             +      , filepath             >= 1.3.0.2       , heredoc              >= 0.2.0.0       , http-conduit         >= 2.1.7.2       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   @@ -381,14 +385,14 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0-      , filepath             +      , filepath             >= 1.3.0.2       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   Test-Suite re-sort-imports-test@@ -408,14 +412,14 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0+        regex                == 1.0.1.0+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*       , directory            >= 1.2.1.0-      , filepath             +      , filepath             >= 1.3.0.2       , shelly               >= 1.6.1.2-      , text                 >= 1.2.0.6+      , text                 == 1.2.*   @@ -435,28 +439,28 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , regex-with-pcre      == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , regex-with-pcre      == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , filepath             +      , filepath             >= 1.3.0.2       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , unordered-containers == 0.2.*   Test-Suite re-tests-test@@ -476,31 +480,97 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , regex-with-pcre      == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , regex-with-pcre      == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , filepath             +      , filepath             >= 1.3.0.2       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , unordered-containers == 0.2.*   +Executable re-top+    Hs-Source-Dirs:     examples++    Main-Is:            re-top.lhs++    Other-Modules:+      TestKit++    Default-Language:   Haskell2010++    GHC-Options:+      -Wall+      -fwarn-tabs+      -Wwarn++    Build-depends:+        regex                == 1.0.1.0+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , blaze-html           >= 0.8.1.0+      , bytestring           == 0.10.*+      , data-default         >= 0.5.3+      , directory            >= 1.2.1.0+      , filepath             >= 1.3.0.2+      , shelly               >= 1.6.1.2+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*+++Test-Suite re-top-test+    type:               exitcode-stdio-1.0+    Hs-Source-Dirs:     examples++    Main-Is:            re-top.lhs++    Other-Modules:+      TestKit++    Default-Language:   Haskell2010++    GHC-Options:+      -Wall+      -fwarn-tabs+      -Wwarn++    Build-depends:+        regex                == 1.0.1.0+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , blaze-html           >= 0.8.1.0+      , bytestring           == 0.10.*+      , data-default         >= 0.5.3+      , directory            >= 1.2.1.0+      , filepath             >= 1.3.0.2+      , shelly               >= 1.6.1.2+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*+++ Executable re-tutorial     Hs-Source-Dirs:     examples @@ -518,30 +588,30 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   Test-Suite re-tutorial-test@@ -562,30 +632,30 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   @@ -608,30 +678,30 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   @@ -652,31 +722,31 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , regex-with-pcre      == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , regex-with-pcre      == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   Test-Suite re-tutorial-options-test@@ -697,31 +767,31 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , regex-with-pcre      == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , regex-with-pcre      == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   @@ -742,30 +812,30 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   Test-Suite re-tutorial-replacing-test@@ -786,30 +856,30 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   @@ -830,30 +900,30 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   Test-Suite re-tutorial-testbench-test@@ -874,30 +944,30 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   @@ -918,30 +988,30 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   @@ -963,30 +1033,30 @@       -Wwarn      Build-depends:-        regex                == 1.0.0.0-      , array                >= 0.4-      , base                 >= 4 && < 5-      , base-compat          >= 0.6.0-      , bytestring           >= 0.10.2.0-      , containers           >= 0.4+        regex                == 1.0.1.0+      , array                >= 0.4      && < 0.6+      , base                 >= 4        && < 5+      , base-compat          >= 0.6      && < 0.10+      , bytestring           == 0.10.*+      , containers           >= 0.4      && < 0.6       , directory            >= 1.2.1.0-      , hashable             >= 1.2.3.3+      , hashable             == 1.2.*       , heredoc              >= 0.2.0.0-      , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35-      , regex-tdfa           >= 1.2.0-      , regex-tdfa-text      >= 1.0.0.3+      , regex-base           == 0.93.*+      , regex-pcre-builtin   == 0.94.*+      , regex-tdfa           == 1.2.*+      , regex-tdfa-text      == 1.0.*       , shelly               >= 1.6.1.2       , smallcheck           >= 1.1.1       , tasty                >= 0.10.1.2       , tasty-hunit          >= 0.9.2       , tasty-smallcheck     >= 0.8.0.1-      , template-haskell     >= 2.7-      , text                 >= 1.2.0.6-      , time                 >= 1.4.2-      , time-locale-compat   >= 0.1.0.1-      , transformers         >= 0.2.2-      , unordered-containers >= 0.2.5.1+      , template-haskell     >= 2.7      && < 2.12+      , text                 == 1.2.*+      , time                 >= 1.4.2    && < 1.9+      , time-locale-compat   == 0.1.*+      , transformers         >= 0.2.2    && < 0.6+      , unordered-containers == 0.2.*   
src/Text/RE/PCRE/ByteString.hs view
@@ -96,7 +96,7 @@ import           Text.RE.ZeInternals.SearchReplace.PCRE.ByteString import           Text.Regex.Base import qualified Text.Regex.PCRE               as PCRE-+-- NB regex-base instance imports maybe be needed for for some API modules  -- | find all the matches in the argument text; e.g., to count the number -- of naturals in s:
src/Text/RE/PCRE/ByteString/Lazy.hs view
@@ -96,7 +96,7 @@ import           Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy import           Text.Regex.Base import qualified Text.Regex.PCRE               as PCRE-+-- NB regex-base instance imports maybe be needed for for some API modules  -- | find all the matches in the argument text; e.g., to count the number -- of naturals in s:
src/Text/RE/PCRE/Sequence.hs view
@@ -96,7 +96,7 @@ import           Text.RE.ZeInternals.SearchReplace.PCRE.Sequence import           Text.Regex.Base import qualified Text.Regex.PCRE               as PCRE-+-- NB regex-base instance imports maybe be needed for for some API modules  -- | find all the matches in the argument text; e.g., to count the number -- of naturals in s:
src/Text/RE/PCRE/String.hs view
@@ -96,7 +96,7 @@ import           Text.RE.ZeInternals.SearchReplace.PCRE.String import           Text.Regex.Base import qualified Text.Regex.PCRE               as PCRE-+-- NB regex-base instance imports maybe be needed for for some API modules  -- | find all the matches in the argument text; e.g., to count the number -- of naturals in s:
+ src/Text/RE/PCRE/Text.hs view
@@ -0,0 +1,217 @@+{-# LANGUAGE NoImplicitPrelude              #-}+{-# LANGUAGE MultiParamTypeClasses          #-}+{-# LANGUAGE FlexibleContexts               #-}+{-# LANGUAGE FlexibleInstances              #-}+{-# OPTIONS_GHC -fno-warn-orphans           #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# LANGUAGE CPP                            #-}+#if __GLASGOW_HASKELL__ >= 800+{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}+#endif++module Text.RE.PCRE.Text+  (+  -- * Tutorial+  -- $tutorial++  -- * The 'Matches' and 'Match' Operators+    (*=~)+  , (?=~)+  -- * The 'SearchReplace' Operators+  , (*=~/)+  , (?=~/)+  -- * The 'Matches' Type+  , Matches+  , matchesSource+  , allMatches+  , anyMatches+  , countMatches+  , matches+  -- * The 'Match' Type+  , Match+  , matchSource+  , matched+  , matchedText+  -- * The Macros and Parsers+  -- $macros+  , module Text.RE.TestBench.Parsers+  -- * The 'RE' Type+  , RE+  , reSource+  -- * Options+  -- $options+  , SimpleREOptions(..)+  -- * Compiling and Escaping REs+  , SearchReplace(..)+  , compileRegex+  , compileRegexWith+  , compileSearchReplace+  , compileSearchReplaceWith+  , escape+  , escapeWith+  , escapeREString+  -- * The Classic regex-base Match Operators+  , (=~)+  , (=~~)+  -- * The re Quasi Quoters+  -- $re+  , re+  , reMultilineSensitive+  , reMultilineInsensitive+  , reBlockSensitive+  , reBlockInsensitive+  , reMS+  , reMI+  , reBS+  , reBI+  , re_+  -- * The Ed Quasi Quoters+  -- $ed+  , edMultilineSensitive+  , edMultilineInsensitive+  , edBlockSensitive+  , edBlockInsensitive+  , ed+  , edMS+  , edMI+  , edBS+  , edBI+  , ed_+  -- * The cp Quasi Quoters+  , cp+  -- * IsRegex+  -- $isregex+  , module Text.RE.Tools.IsRegex+  ) where++import qualified Data.Text                     as T+import           Data.Typeable+import           Prelude.Compat+import           Text.RE.REOptions+import           Text.RE.Replace+import           Text.RE.TestBench.Parsers+import           Text.RE.Tools.IsRegex+import           Text.RE.ZeInternals+import           Text.RE.ZeInternals.PCRE+import           Text.RE.ZeInternals.SearchReplace.PCRE.Text+import           Text.Regex.Base+import qualified Text.Regex.PCRE               as PCRE+import           Text.Regex.PCRE.Text()++-- | find all the matches in the argument text; e.g., to count the number+-- of naturals in s:+--+--   @countMatches $ s *=~ [re|[0-9]+|]@+--+(*=~) :: T.Text+      -> RE+      -> Matches T.Text+(*=~) bs rex = addCaptureNamesToMatches (reCaptureNames rex) $ match (reRegex rex) bs++-- | find the first match in the argument text; e.g., to test if there+-- is a natural number in the input text:+--+--   @matched $ s ?=~ [re|[0-9]+|]@+--+(?=~) :: T.Text+      -> RE+      -> Match T.Text+(?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs++-- | search and replace all matches in the argument text; e.g., this section+-- will convert every YYYY-MM-DD format date in its argument text into a+-- DD\/MM\/YYYY date:+--+--   @(*=~\/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})\/\/\/${d}\/${m}\/${y}|])@+--+(*=~/) :: T.Text -> SearchReplace RE T.Text -> T.Text+(*=~/) = flip searchReplaceAll++-- | search and replace the first occurrence only (if any) in the input text+-- e.g., to prefix the first string of four hex digits in the input text,+-- if any, with @0x@:+--+--  @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])@+--+(?=~/) :: T.Text -> SearchReplace RE T.Text -> T.Text+(?=~/) = flip searchReplaceFirst++-- | the `regex-base` polymorphic match operator+(=~) :: ( Typeable a+        , RegexContext PCRE.Regex T.Text a+        )+     => T.Text+     -> RE+     -> a+(=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs++-- | the `regex-base` monadic, polymorphic match operator+(=~~) :: ( Monad m+         , Functor m+         , Typeable a+         , RegexContext PCRE.Regex T.Text a+         )+      => T.Text+      -> RE+      -> m a+(=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs++instance IsRegex RE T.Text where+  matchOnce             = flip (?=~)+  matchMany             = flip (*=~)+  makeRegexWith         = \o -> compileRegexWith o . unpackR+  makeSearchReplaceWith = \o r t -> compileSearchReplaceWith o (unpackR r) (unpackR t)+  regexSource           = packR . reSource++-- $tutorial+-- We have a regex tutorial at <http://tutorial.regex.uk>.++-- $macros+-- There are a number of RE macros and corresponding Haskell parsers+-- for parsing the matched text into appropriate Haskell types. See+-- the [Macros Tables](http://regex.uk/macros) for details.++-- $options+-- You can specify different compilation options by appending a+-- to the name of an [re| ... |] or [ed| ... \/\/\/ ... |] quasi quoter+-- to select the corresponding compilation option. For example, the+-- section,+--+--  @(?=~/ [edBlockInsensitive|foo$\/\/\/bar|])@+--+-- will replace a @foo@ suffix of the argument text, of any+-- capitalisation, with a (lower case) @bar@. If you need to specify the+-- options dynamically, use the @[re_| ... |]@ and @[ed_| ... \/\/\/ ... |]@+-- quasi quoters, which generate functions that take an 'IsOption' option+-- (e.g., a 'SimpleReOptions' value) and yields a 'RE' or 'SearchReplace'+-- as apropriate. For example if you have a 'SimpleReOptions' value in+-- @sro@ then+--+--  @(?=~/ [ed_|foo$\/\/\/bar|] sro)@+--+-- will compile the @foo$@ RE according to the value of @sro@. For more+-- on specifying RE options see "Text.RE.REOptions".++-- $re+-- The @[re|.*|]@ quasi quoters, with variants for specifing different+-- options to the RE compiler (see "Text.RE.REOptions"), and the+-- specialised back-end types and functions.++-- $ed+-- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifing different+-- options to the RE compiler (see "Text.RE.REOptions").++-- $ed+-- The -- | the @[ed| ... \/\/\/ ... |]@ quasi quoters; for example,+--+--  @[ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})\/\/\/${d}\/${m}\/${y}|])@+--+-- represents a @SearchReplace@ that will convert a YYYY-MM-DD format date+-- into a DD\/MM\/YYYY format date.+--+-- The only difference betweem these quasi quoters is the RE options that are set,+-- using the same conventions as the @[re| ... |]@ quasi quoters.++-- $isregex+-- The 'IsRegex' class is used to abstact over the different regex back ends and+-- the text types they work with -- see "Text.RE.Tools.IsRegex" for details.
+ src/Text/RE/PCRE/Text/Lazy.hs view
@@ -0,0 +1,217 @@+{-# LANGUAGE NoImplicitPrelude              #-}+{-# LANGUAGE MultiParamTypeClasses          #-}+{-# LANGUAGE FlexibleContexts               #-}+{-# LANGUAGE FlexibleInstances              #-}+{-# OPTIONS_GHC -fno-warn-orphans           #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# LANGUAGE CPP                            #-}+#if __GLASGOW_HASKELL__ >= 800+{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}+#endif++module Text.RE.PCRE.Text.Lazy+  (+  -- * Tutorial+  -- $tutorial++  -- * The 'Matches' and 'Match' Operators+    (*=~)+  , (?=~)+  -- * The 'SearchReplace' Operators+  , (*=~/)+  , (?=~/)+  -- * The 'Matches' Type+  , Matches+  , matchesSource+  , allMatches+  , anyMatches+  , countMatches+  , matches+  -- * The 'Match' Type+  , Match+  , matchSource+  , matched+  , matchedText+  -- * The Macros and Parsers+  -- $macros+  , module Text.RE.TestBench.Parsers+  -- * The 'RE' Type+  , RE+  , reSource+  -- * Options+  -- $options+  , SimpleREOptions(..)+  -- * Compiling and Escaping REs+  , SearchReplace(..)+  , compileRegex+  , compileRegexWith+  , compileSearchReplace+  , compileSearchReplaceWith+  , escape+  , escapeWith+  , escapeREString+  -- * The Classic regex-base Match Operators+  , (=~)+  , (=~~)+  -- * The re Quasi Quoters+  -- $re+  , re+  , reMultilineSensitive+  , reMultilineInsensitive+  , reBlockSensitive+  , reBlockInsensitive+  , reMS+  , reMI+  , reBS+  , reBI+  , re_+  -- * The Ed Quasi Quoters+  -- $ed+  , edMultilineSensitive+  , edMultilineInsensitive+  , edBlockSensitive+  , edBlockInsensitive+  , ed+  , edMS+  , edMI+  , edBS+  , edBI+  , ed_+  -- * The cp Quasi Quoters+  , cp+  -- * IsRegex+  -- $isregex+  , module Text.RE.Tools.IsRegex+  ) where++import qualified Data.Text.Lazy                as TL+import           Data.Typeable+import           Prelude.Compat+import           Text.RE.REOptions+import           Text.RE.Replace+import           Text.RE.TestBench.Parsers+import           Text.RE.Tools.IsRegex+import           Text.RE.ZeInternals+import           Text.RE.ZeInternals.PCRE+import           Text.RE.ZeInternals.SearchReplace.PCRE.Text.Lazy+import           Text.Regex.Base+import qualified Text.Regex.PCRE               as PCRE+import           Text.Regex.PCRE.Text.Lazy()++-- | find all the matches in the argument text; e.g., to count the number+-- of naturals in s:+--+--   @countMatches $ s *=~ [re|[0-9]+|]@+--+(*=~) :: TL.Text+      -> RE+      -> Matches TL.Text+(*=~) bs rex = addCaptureNamesToMatches (reCaptureNames rex) $ match (reRegex rex) bs++-- | find the first match in the argument text; e.g., to test if there+-- is a natural number in the input text:+--+--   @matched $ s ?=~ [re|[0-9]+|]@+--+(?=~) :: TL.Text+      -> RE+      -> Match TL.Text+(?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs++-- | search and replace all matches in the argument text; e.g., this section+-- will convert every YYYY-MM-DD format date in its argument text into a+-- DD\/MM\/YYYY date:+--+--   @(*=~\/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})\/\/\/${d}\/${m}\/${y}|])@+--+(*=~/) :: TL.Text -> SearchReplace RE TL.Text -> TL.Text+(*=~/) = flip searchReplaceAll++-- | search and replace the first occurrence only (if any) in the input text+-- e.g., to prefix the first string of four hex digits in the input text,+-- if any, with @0x@:+--+--  @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])@+--+(?=~/) :: TL.Text -> SearchReplace RE TL.Text -> TL.Text+(?=~/) = flip searchReplaceFirst++-- | the `regex-base` polymorphic match operator+(=~) :: ( Typeable a+        , RegexContext PCRE.Regex TL.Text a+        )+     => TL.Text+     -> RE+     -> a+(=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs++-- | the `regex-base` monadic, polymorphic match operator+(=~~) :: ( Monad m+         , Functor m+         , Typeable a+         , RegexContext PCRE.Regex TL.Text a+         )+      => TL.Text+      -> RE+      -> m a+(=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs++instance IsRegex RE TL.Text where+  matchOnce             = flip (?=~)+  matchMany             = flip (*=~)+  makeRegexWith         = \o -> compileRegexWith o . unpackR+  makeSearchReplaceWith = \o r t -> compileSearchReplaceWith o (unpackR r) (unpackR t)+  regexSource           = packR . reSource++-- $tutorial+-- We have a regex tutorial at <http://tutorial.regex.uk>.++-- $macros+-- There are a number of RE macros and corresponding Haskell parsers+-- for parsing the matched text into appropriate Haskell types. See+-- the [Macros Tables](http://regex.uk/macros) for details.++-- $options+-- You can specify different compilation options by appending a+-- to the name of an [re| ... |] or [ed| ... \/\/\/ ... |] quasi quoter+-- to select the corresponding compilation option. For example, the+-- section,+--+--  @(?=~/ [edBlockInsensitive|foo$\/\/\/bar|])@+--+-- will replace a @foo@ suffix of the argument text, of any+-- capitalisation, with a (lower case) @bar@. If you need to specify the+-- options dynamically, use the @[re_| ... |]@ and @[ed_| ... \/\/\/ ... |]@+-- quasi quoters, which generate functions that take an 'IsOption' option+-- (e.g., a 'SimpleReOptions' value) and yields a 'RE' or 'SearchReplace'+-- as apropriate. For example if you have a 'SimpleReOptions' value in+-- @sro@ then+--+--  @(?=~/ [ed_|foo$\/\/\/bar|] sro)@+--+-- will compile the @foo$@ RE according to the value of @sro@. For more+-- on specifying RE options see "Text.RE.REOptions".++-- $re+-- The @[re|.*|]@ quasi quoters, with variants for specifing different+-- options to the RE compiler (see "Text.RE.REOptions"), and the+-- specialised back-end types and functions.++-- $ed+-- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifing different+-- options to the RE compiler (see "Text.RE.REOptions").++-- $ed+-- The -- | the @[ed| ... \/\/\/ ... |]@ quasi quoters; for example,+--+--  @[ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})\/\/\/${d}\/${m}\/${y}|])@+--+-- represents a @SearchReplace@ that will convert a YYYY-MM-DD format date+-- into a DD\/MM\/YYYY format date.+--+-- The only difference betweem these quasi quoters is the RE options that are set,+-- using the same conventions as the @[re| ... |]@ quasi quoters.++-- $isregex+-- The 'IsRegex' class is used to abstact over the different regex back ends and+-- the text types they work with -- see "Text.RE.Tools.IsRegex" for details.
src/Text/RE/TDFA/ByteString.hs view
@@ -96,7 +96,7 @@ import           Text.RE.ZeInternals.TDFA import           Text.Regex.Base import qualified Text.Regex.TDFA               as TDFA-+-- NB regex-base instance imports maybe be needed for for some API modules  -- | find all the matches in the argument text; e.g., to count the number -- of naturals in s:
src/Text/RE/TDFA/ByteString/Lazy.hs view
@@ -96,7 +96,7 @@ import           Text.RE.ZeInternals.TDFA import           Text.Regex.Base import qualified Text.Regex.TDFA               as TDFA-+-- NB regex-base instance imports maybe be needed for for some API modules  -- | find all the matches in the argument text; e.g., to count the number -- of naturals in s:
src/Text/RE/TDFA/Sequence.hs view
@@ -96,7 +96,7 @@ import           Text.RE.ZeInternals.TDFA import           Text.Regex.Base import qualified Text.Regex.TDFA               as TDFA-+-- NB regex-base instance imports maybe be needed for for some API modules  -- | find all the matches in the argument text; e.g., to count the number -- of naturals in s:
src/Text/RE/TDFA/String.hs view
@@ -96,7 +96,7 @@ import           Text.RE.ZeInternals.TDFA import           Text.Regex.Base import qualified Text.Regex.TDFA               as TDFA-+-- NB regex-base instance imports maybe be needed for for some API modules  -- | find all the matches in the argument text; e.g., to count the number -- of naturals in s:
src/Text/RE/TDFA/Text.hs view
@@ -96,7 +96,7 @@ import           Text.RE.ZeInternals.TDFA import           Text.Regex.Base import qualified Text.Regex.TDFA               as TDFA-+-- NB regex-base instance imports maybe be needed for for some API modules  -- | find all the matches in the argument text; e.g., to count the number -- of naturals in s:
src/Text/RE/TDFA/Text/Lazy.hs view
@@ -96,7 +96,7 @@ import           Text.RE.ZeInternals.TDFA import           Text.Regex.Base import qualified Text.Regex.TDFA               as TDFA-+-- NB regex-base instance imports maybe be needed for for some API modules  -- | find all the matches in the argument text; e.g., to count the number -- of naturals in s:
stack-8.0.yaml view
@@ -1,7 +1,8 @@-resolver: lts-8.6+resolver: lts-8.16 install-ghc: true flags: {} packages: - '.' system-ghc: false-extra-deps: []+extra-deps:+  - regex-pcre-text-0.94.0.0