regex-examples 1.1.0.0 → 1.1.0.1
raw patch · 11 files changed
+103/−81 lines, 11 filesdep +stmdep +typed-processdep −http-conduitdep ~regex-tdfa
Dependencies added: stm, typed-process
Dependencies removed: http-conduit
Dependency ranges changed: regex-tdfa
Files
- README.md +1/−0
- changelog +4/−0
- examples/re-gen-cabals.lhs +2/−2
- examples/re-prep.lhs +23/−2
- examples/re-tests.lhs +2/−11
- examples/re-top.lhs +17/−16
- lib/cabal-masters/constraints-incl.cabal +1/−1
- lib/cabal-masters/executables-incl.cabal +1/−1
- lib/mega-regex.cabal +26/−24
- lib/version.txt +1/−1
- regex-examples.cabal +25/−23
README.md view
@@ -43,6 +43,7 @@ - [X] 2018-12-18 v1.0.1.5 [TDFA quasi quoters not dealing with newlines](https://github.com/iconnect/regex/milestone/24) - [X] 2018-12-19 v1.0.2.0 [Tidy build issues](https://github.com/iconnect/regex/milestone/25) - [X] 2020-01-27 v1.1.0.0 [Adapt for MonadFail/base-4.13/GHC-8.8](https://github.com/iconnect/regex/milestone/26)+- [X] 2021-12-18 v1.1.0.1 [Fix for base-4.16.0.0/GHC 9.2.1](https://github.com/iconnect/regex/milestone/27) See the [Roadmap page](http://roadmap.regex.uk) for details.
changelog view
@@ -1,5 +1,9 @@ -*-change-log-*- +1.1.0.1 Chris Dornan <chris.dornan@irisconnect.co.uk> 2018-12-19+ * fix for base-4.16.0.0/GHC 9.2.1+ * eliminate http-conduit dependency (currently stymied by cryptonite)+ 1.1.0.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2018-12-19 * drop support for GHC 8.0 and below * adapt for base 4.13 (MonadFail)
examples/re-gen-cabals.lhs view
@@ -316,7 +316,7 @@ establish nm nm SH.shelly $ SH.verbosely $ do SH.cp readme "README.markdown"- SH.run_ "stack" ["sdist","--stack-yaml","stack-8.8.yaml"]+ SH.run_ "stack" ["sdist","--stack-yaml","stack-9.2.yaml"] (pth,tb) <- analyse_so <$> SH.lastStderr SH.cp (SH.fromText $ pth) $ SH.fromText $ "releases/" M.<> tb where@@ -371,7 +371,7 @@ LBS.readFile "tmp/commit.txt" >>= LBS.putStrLn commit_message_ :: FilePath -> Vrn -> T.Text -> IO ()-commit_message_ fp vrn@Vrn{..} smy_t = do+commit_message_ fp vrn@Vrn{} smy_t = do rex <- escape ("^"++) vrn_s parse_commit smy_ln <$> grepLines rex "changelog" >>= LBS.writeFile fp where
examples/re-prep.lhs view
@@ -23,6 +23,7 @@ ) where import Control.Applicative+import Control.Concurrent.STM (atomically) import qualified Data.ByteString.Char8 as B import qualified Data.ByteString.Lazy.Char8 as LBS import Data.IORef@@ -30,13 +31,13 @@ import Data.Maybe import qualified Data.Monoid as M import qualified Data.Text as T-import Network.HTTP.Conduit import Prelude.Compat import qualified Shelly as SH import System.Directory import System.Environment import System.FilePath import System.IO+import System.Process.Typed import TestKit import Text.Heredoc import Text.RE.Replace@@ -44,6 +45,15 @@ import qualified Text.RE.TDFA.String as TS import Text.RE.Tools.Grep import Text.RE.Tools.Sed+-- import Control.Monad.IO.Class+-- import Network.HTTP.Conduit+++-- import qualified Data.ByteString.Lazy as L+-- import qualified Data.ByteString.Lazy.Char8 as L8+-- import Control.Exception (throwIO)++ \end{code} \begin{code}@@ -440,9 +450,20 @@ where collect (nm,url) = do putStrLn $ "updating badge: " ++ nm- simpleHttp url >>= LBS.writeFile (badge_fn nm)+ curl url >>= LBS.writeFile (badge_fn nm) badge_fn nm = "docs/badges/"++nm++".svg"++ curl :: String -> IO LBS.ByteString+ curl url = withProcessWait_ curl_ go+ where+ go p = atomically (getStdout p)++ curl_ = setStdin createPipe+ $ setStdout byteStringOutput+ $ proc "curl" [url]++ \end{code}
examples/re-tests.lhs view
@@ -9,6 +9,7 @@ \begin{code}+{-# LANGUAGE CPP #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-}@@ -32,6 +33,7 @@ import qualified Data.ByteString.UTF8 as B import Data.Char import qualified Data.Foldable as F+import Data.Functor.Identity import qualified Data.HashMap.Strict as HM import Data.Maybe import qualified Data.Monoid as M@@ -990,17 +992,6 @@ s_toList :: S.Seq Char -> [Char] s_toList = F.toList--newtype Identity a = Identity { runIdentity :: a }- deriving (Functor)--instance Applicative Identity where- pure = Identity- (<*>) (Identity f) (Identity x) = Identity $ f x--instance Monad Identity where- return = Identity- (>>=) (Identity x) f = f x isValidError :: a -> IO Bool isValidError x = catch (x `seq` return False) hdl
examples/re-top.lhs view
@@ -113,14 +113,15 @@ These vectors have expected zeros and sums. \begin{code}-#if __GLASGOW_HASKELL__ >= 804-instance Semigroup Results where- (<>) = mappend_r-#endif- instance Monoid Results where mempty = mempty_r+#if __GLASGOW_HASKELL__ < 804 mappend = mappend_r+#else++instance Semigroup Results where+ (<>) = mappend_r+#endif \end{code} @@ -270,7 +271,7 @@ \begin{code} input :: Job -> IO [Game] input Job{..} =- groupSort const . parseGames . T.concat <$> mapM T.readFile jobInputs+ groupSort const . parseGames PrimParseGames . T.concat <$> mapM T.readFile jobInputs \end{code} @@ -280,8 +281,8 @@ The Game parser has three variants that should all be equivalent. \begin{code}-parseGames :: T.Text -> [Game]-parseGames = case PrimParseGames of+parseGames :: ParseGames -> T.Text -> [Game]+parseGames which = case which of SimpleParseGames -> simpleParseGames FunParseGames -> funParseGames PrimParseGames -> primParseGames@@ -307,7 +308,7 @@ \begin{code} simpleParseGames :: T.Text -> [Game]-simpleParseGames = map readText . T.lines . edit gameEdit+simpleParseGames = map readText . T.lines . edit (gameEdit MacrosGameEdit) \end{code} The `[ed|` ... `///` ... `|]` `SearchReplace` editors for recognizing@@ -315,8 +316,8 @@ `Game` data come in two variants that should be equivalent. \begin{code}-gameEdit :: SearchReplace RE T.Text-gameEdit = case MacrosGameEdit of+gameEdit :: GameEdit -> SearchReplace RE T.Text+gameEdit which = case which of SimpleGameEdit -> simpleGameEdit MacrosGameEdit -> macrosGameEdit @@ -406,7 +407,7 @@ (readText $ mtch !$$ [cp|hs|]) (readText $ mtch !$$ [cp|as|]) ( mtch !$$ [cp|at|])- | Line{..} <- grepFilter rex txt+ | Line{..} <- grepFilter (rex Direct) txt , [mtch] <- [allMatches getLineMatches] ] \end{code}@@ -417,12 +418,12 @@ course be equivalent.) \begin{code}-rex :: RE-rex = case Direct of+rex :: REX -> RE+rex which = case which of Direct -> [re_|^ *${ht}(@{team}) +${hs}([0-9]+)-${as}([0-9]+) +(\([0-9]+-[0-9]+\) *)?${at}(@{team}) *(@.*)?$|] macs Recycle ->- getSearch gameEdit+ getSearch (gameEdit MacrosGameEdit) data REX = Direct | Recycle \end{code}@@ -440,7 +441,7 @@ (readText $ mtch !$$ [cp|hs|]) (readText $ mtch !$$ [cp|as|]) ( mtch !$$ [cp|at|])- | mtch <- map (?=~ rex) $ T.lines txt+ | mtch <- map (?=~ rex Direct) $ T.lines txt , matched mtch ] \end{code}
lib/cabal-masters/constraints-incl.cabal view
@@ -13,7 +13,7 @@ %- pandoc >= 1.13.2.1 %- regex-base >= 0.93 %- regex-pcre-builtin >= 0.94-%- regex-tdfa >= 1.2+%- regex-tdfa >= 1.3.1.0 %- shelly >= 1.6.1.2 %- smallcheck >= 1.1.1 %- tasty >= 0.10.1.2
lib/cabal-masters/executables-incl.cabal view
@@ -46,7 +46,7 @@ Other-Modules: TestKit -%build-depends-prog regex base base-compat bytestring directory filepath heredoc http-conduit shelly text+%build-depends-prog regex base base-compat bytestring directory filepath heredoc shelly stm typed-process text %test-exe re-sort-imports Hs-Source-Dirs: examples
lib/mega-regex.cabal view
@@ -1,5 +1,5 @@ Name: regex-Version: 1.1.0.0+Version: 1.1.0.1 Synopsis: Toolkit for regex-base Description: A regular expression toolkit for regex-base with compile-time checking of RE syntax, data types for@@ -67,7 +67,7 @@ Source-Repository this Type: git Location: https://github.com/iconnect/regex.git- Tag: 1.1.0.0+ Tag: 1.1.0.1 @@ -183,7 +183,7 @@ , hashable >= 1.2 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , template-haskell >= 2.7 , text >= 1.2 , time >= 1.4.2@@ -217,7 +217,7 @@ , containers >= 0.4 , directory >= 1.2.1.0 , regex-base >= 0.93- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , text >= 1.2 @@ -247,7 +247,7 @@ , containers >= 0.4 , directory >= 1.2.1.0 , regex-base >= 0.93- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , text >= 1.2 @@ -276,7 +276,7 @@ , bytestring >= 0.10 , directory >= 1.2.1.0 , regex-base >= 0.93- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , text >= 1.2 @@ -305,7 +305,7 @@ , bytestring >= 0.10 , directory >= 1.2.1.0 , regex-base >= 0.93- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , text >= 1.2 @@ -387,7 +387,7 @@ , directory >= 1.2.1.0 , filepath >= 1.3.0.2 , regex-base >= 0.93- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , text >= 1.2 , time >= 1.4.2@@ -421,7 +421,7 @@ , directory >= 1.2.1.0 , filepath >= 1.3.0.2 , regex-base >= 0.93- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , text >= 1.2 , time >= 1.4.2@@ -454,9 +454,10 @@ , directory >= 1.2.1.0 , filepath >= 1.3.0.2 , heredoc >= 0.2.0.0- , http-conduit >= 2.1.7.2 , shelly >= 1.6.1.2+ , stm , text >= 1.2+ , typed-process Test-Suite re-prep-test@@ -483,9 +484,10 @@ , directory >= 1.2.1.0 , filepath >= 1.3.0.2 , heredoc >= 0.2.0.0- , http-conduit >= 2.1.7.2 , shelly >= 1.6.1.2+ , stm , text >= 1.2+ , typed-process @@ -570,7 +572,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -610,7 +612,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -717,7 +719,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -760,7 +762,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -805,7 +807,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -848,7 +850,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -891,7 +893,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -934,7 +936,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -977,7 +979,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -1020,7 +1022,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -1063,7 +1065,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -1106,7 +1108,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -1150,7 +1152,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2
lib/version.txt view
@@ -1,1 +1,1 @@-1.1.0.0+1.1.0.1
regex-examples.cabal view
@@ -1,5 +1,5 @@ Name: regex-examples-Version: 1.1.0.0+Version: 1.1.0.1 Synopsis: Tutorial, tests and example programs for regex Description: Tutorial, tests and example programs for regex, a Regular Expression Toolkit for regex-base with@@ -67,7 +67,7 @@ Source-Repository this Type: git Location: https://github.com/iconnect/regex.git- Tag: 1.1.0.0+ Tag: 1.1.0.1 Executable re-gen-cabals@@ -94,7 +94,7 @@ , containers >= 0.4 , directory >= 1.2.1.0 , regex-base >= 0.93- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , text >= 1.2 @@ -124,7 +124,7 @@ , containers >= 0.4 , directory >= 1.2.1.0 , regex-base >= 0.93- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , text >= 1.2 @@ -153,7 +153,7 @@ , bytestring >= 0.10 , directory >= 1.2.1.0 , regex-base >= 0.93- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , text >= 1.2 @@ -182,7 +182,7 @@ , bytestring >= 0.10 , directory >= 1.2.1.0 , regex-base >= 0.93- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , text >= 1.2 @@ -265,7 +265,7 @@ , directory >= 1.2.1.0 , filepath >= 1.3.0.2 , regex-base >= 0.93- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , text >= 1.2 , time >= 1.4.2@@ -300,7 +300,7 @@ , directory >= 1.2.1.0 , filepath >= 1.3.0.2 , regex-base >= 0.93- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , text >= 1.2 , time >= 1.4.2@@ -333,9 +333,10 @@ , directory >= 1.2.1.0 , filepath >= 1.3.0.2 , heredoc >= 0.2.0.0- , http-conduit >= 2.1.7.2 , shelly >= 1.6.1.2+ , stm , text >= 1.2+ , typed-process Test-Suite re-prep-test@@ -362,9 +363,10 @@ , directory >= 1.2.1.0 , filepath >= 1.3.0.2 , heredoc >= 0.2.0.0- , http-conduit >= 2.1.7.2 , shelly >= 1.6.1.2+ , stm , text >= 1.2+ , typed-process @@ -450,7 +452,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -491,7 +493,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -598,7 +600,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -641,7 +643,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -686,7 +688,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -730,7 +732,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -774,7 +776,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -817,7 +819,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -860,7 +862,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -903,7 +905,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -946,7 +948,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -989,7 +991,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2@@ -1033,7 +1035,7 @@ , heredoc >= 0.2.0.0 , regex-base >= 0.93 , regex-pcre-builtin >= 0.94- , regex-tdfa >= 1.2+ , regex-tdfa >= 1.3.1.0 , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2