packages feed

regex-with-pcre 1.0.2.0 → 1.1.0.0

raw patch · 14 files changed

+85/−59 lines, 14 filesdep −regex-pcre-textdep ~base-compatdep ~bytestringdep ~regex-basePVP ok

version bump matches the API change (PVP)

Dependencies removed: regex-pcre-text

Dependency ranges changed: base-compat, bytestring, regex-base, regex-pcre-builtin, regex-tdfa, text, unordered-containers

API changes (from Hackage documentation)

- Text.RE.PCRE: (=~~) :: (Monad m, RegexContext Regex s a, RegexMaker Regex CompOption ExecOption s) => s -> RE -> m a
+ Text.RE.PCRE: (=~~) :: (Monad m, MonadFail m, RegexContext Regex s a, RegexMaker Regex CompOption ExecOption s) => s -> RE -> m a
- Text.RE.PCRE: compileRegex :: (Functor m, Monad m) => String -> m RE
+ Text.RE.PCRE: compileRegex :: (Functor m, Monad m, MonadFail m) => String -> m RE
- Text.RE.PCRE: compileRegexWith :: (Functor m, Monad m) => SimpleREOptions -> String -> m RE
+ Text.RE.PCRE: compileRegexWith :: (Functor m, Monad m, MonadFail m) => SimpleREOptions -> String -> m RE
- Text.RE.PCRE: compileRegexWithOptions :: (IsOption o, Functor m, Monad m) => o -> String -> m RE
+ Text.RE.PCRE: compileRegexWithOptions :: (IsOption o, Functor m, Monad m, MonadFail m) => o -> String -> m RE
- Text.RE.PCRE: compileSearchReplace :: (Monad m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)
+ Text.RE.PCRE: compileSearchReplace :: (Monad m, MonadFail m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)
- Text.RE.PCRE: compileSearchReplaceWith :: (Monad m, Functor m, IsRegex RE s) => SimpleREOptions -> String -> String -> m (SearchReplace RE s)
+ Text.RE.PCRE: compileSearchReplaceWith :: (Monad m, MonadFail m, Functor m, IsRegex RE s) => SimpleREOptions -> String -> String -> m (SearchReplace RE s)
- Text.RE.PCRE: compileSearchReplaceWithOptions :: (Monad m, Functor m, IsRegex RE s) => REOptions -> String -> String -> m (SearchReplace RE s)
+ Text.RE.PCRE: compileSearchReplaceWithOptions :: (Monad m, MonadFail m, Functor m, IsRegex RE s) => REOptions -> String -> String -> m (SearchReplace RE s)
- Text.RE.PCRE: escape :: (Functor m, Monad m) => (String -> String) -> String -> m RE
+ Text.RE.PCRE: escape :: (Functor m, Monad m, MonadFail m) => (String -> String) -> String -> m RE
- Text.RE.PCRE: escapeWith :: (Functor m, Monad m) => SimpleREOptions -> (String -> String) -> String -> m RE
+ Text.RE.PCRE: escapeWith :: (Functor m, Monad m, MonadFail m) => SimpleREOptions -> (String -> String) -> String -> m RE
- Text.RE.PCRE: escapeWithOptions :: (IsOption o, Functor m, Monad m) => o -> (String -> String) -> String -> m RE
+ Text.RE.PCRE: escapeWithOptions :: (IsOption o, Functor m, Monad m, MonadFail m) => o -> (String -> String) -> String -> m RE
- Text.RE.PCRE.ByteString: (=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex ByteString a) => ByteString -> RE -> m a
+ Text.RE.PCRE.ByteString: (=~~) :: (Monad m, MonadFail m, Functor m, Typeable a, RegexContext Regex ByteString a) => ByteString -> RE -> m a
- Text.RE.PCRE.ByteString: compileRegex :: (Functor m, Monad m) => String -> m RE
+ Text.RE.PCRE.ByteString: compileRegex :: (Functor m, Monad m, MonadFail m) => String -> m RE
- Text.RE.PCRE.ByteString: compileRegexWith :: (Functor m, Monad m) => SimpleREOptions -> String -> m RE
+ Text.RE.PCRE.ByteString: compileRegexWith :: (Functor m, Monad m, MonadFail m) => SimpleREOptions -> String -> m RE
- Text.RE.PCRE.ByteString: compileSearchReplace :: (Monad m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)
+ Text.RE.PCRE.ByteString: compileSearchReplace :: (Monad m, MonadFail m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)
- Text.RE.PCRE.ByteString: compileSearchReplaceWith :: (Monad m, Functor m, IsRegex RE s) => SimpleREOptions -> String -> String -> m (SearchReplace RE s)
+ Text.RE.PCRE.ByteString: compileSearchReplaceWith :: (Monad m, MonadFail m, Functor m, IsRegex RE s) => SimpleREOptions -> String -> String -> m (SearchReplace RE s)
- Text.RE.PCRE.ByteString: escape :: (Functor m, Monad m) => (String -> String) -> String -> m RE
+ Text.RE.PCRE.ByteString: escape :: (Functor m, Monad m, MonadFail m) => (String -> String) -> String -> m RE
- Text.RE.PCRE.ByteString: escapeWith :: (Functor m, Monad m) => SimpleREOptions -> (String -> String) -> String -> m RE
+ Text.RE.PCRE.ByteString: escapeWith :: (Functor m, Monad m, MonadFail m) => SimpleREOptions -> (String -> String) -> String -> m RE
- Text.RE.PCRE.ByteString.Lazy: (=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex ByteString a) => ByteString -> RE -> m a
+ Text.RE.PCRE.ByteString.Lazy: (=~~) :: (Monad m, MonadFail m, Functor m, Typeable a, RegexContext Regex ByteString a) => ByteString -> RE -> m a
- Text.RE.PCRE.ByteString.Lazy: compileRegex :: (Functor m, Monad m) => String -> m RE
+ Text.RE.PCRE.ByteString.Lazy: compileRegex :: (Functor m, Monad m, MonadFail m) => String -> m RE
- Text.RE.PCRE.ByteString.Lazy: compileRegexWith :: (Functor m, Monad m) => SimpleREOptions -> String -> m RE
+ Text.RE.PCRE.ByteString.Lazy: compileRegexWith :: (Functor m, Monad m, MonadFail m) => SimpleREOptions -> String -> m RE
- Text.RE.PCRE.ByteString.Lazy: compileSearchReplace :: (Monad m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)
+ Text.RE.PCRE.ByteString.Lazy: compileSearchReplace :: (Monad m, MonadFail m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)
- Text.RE.PCRE.ByteString.Lazy: compileSearchReplaceWith :: (Monad m, Functor m, IsRegex RE s) => SimpleREOptions -> String -> String -> m (SearchReplace RE s)
+ Text.RE.PCRE.ByteString.Lazy: compileSearchReplaceWith :: (Monad m, MonadFail m, Functor m, IsRegex RE s) => SimpleREOptions -> String -> String -> m (SearchReplace RE s)
- Text.RE.PCRE.ByteString.Lazy: escape :: (Functor m, Monad m) => (String -> String) -> String -> m RE
+ Text.RE.PCRE.ByteString.Lazy: escape :: (Functor m, Monad m, MonadFail m) => (String -> String) -> String -> m RE
- Text.RE.PCRE.ByteString.Lazy: escapeWith :: (Functor m, Monad m) => SimpleREOptions -> (String -> String) -> String -> m RE
+ Text.RE.PCRE.ByteString.Lazy: escapeWith :: (Functor m, Monad m, MonadFail m) => SimpleREOptions -> (String -> String) -> String -> m RE
- Text.RE.PCRE.Sequence: (=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex (Seq Char) a) => Seq Char -> RE -> m a
+ Text.RE.PCRE.Sequence: (=~~) :: (Monad m, MonadFail m, Functor m, Typeable a, RegexContext Regex (Seq Char) a) => Seq Char -> RE -> m a
- Text.RE.PCRE.Sequence: compileRegex :: (Functor m, Monad m) => String -> m RE
+ Text.RE.PCRE.Sequence: compileRegex :: (Functor m, Monad m, MonadFail m) => String -> m RE
- Text.RE.PCRE.Sequence: compileRegexWith :: (Functor m, Monad m) => SimpleREOptions -> String -> m RE
+ Text.RE.PCRE.Sequence: compileRegexWith :: (Functor m, Monad m, MonadFail m) => SimpleREOptions -> String -> m RE
- Text.RE.PCRE.Sequence: compileSearchReplace :: (Monad m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)
+ Text.RE.PCRE.Sequence: compileSearchReplace :: (Monad m, MonadFail m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)
- Text.RE.PCRE.Sequence: compileSearchReplaceWith :: (Monad m, Functor m, IsRegex RE s) => SimpleREOptions -> String -> String -> m (SearchReplace RE s)
+ Text.RE.PCRE.Sequence: compileSearchReplaceWith :: (Monad m, MonadFail m, Functor m, IsRegex RE s) => SimpleREOptions -> String -> String -> m (SearchReplace RE s)
- Text.RE.PCRE.Sequence: escape :: (Functor m, Monad m) => (String -> String) -> String -> m RE
+ Text.RE.PCRE.Sequence: escape :: (Functor m, Monad m, MonadFail m) => (String -> String) -> String -> m RE
- Text.RE.PCRE.Sequence: escapeWith :: (Functor m, Monad m) => SimpleREOptions -> (String -> String) -> String -> m RE
+ Text.RE.PCRE.Sequence: escapeWith :: (Functor m, Monad m, MonadFail m) => SimpleREOptions -> (String -> String) -> String -> m RE
- Text.RE.PCRE.String: (=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex String a) => String -> RE -> m a
+ Text.RE.PCRE.String: (=~~) :: (Monad m, MonadFail m, Functor m, Typeable a, RegexContext Regex String a) => String -> RE -> m a
- Text.RE.PCRE.String: compileRegex :: (Functor m, Monad m) => String -> m RE
+ Text.RE.PCRE.String: compileRegex :: (Functor m, Monad m, MonadFail m) => String -> m RE
- Text.RE.PCRE.String: compileRegexWith :: (Functor m, Monad m) => SimpleREOptions -> String -> m RE
+ Text.RE.PCRE.String: compileRegexWith :: (Functor m, Monad m, MonadFail m) => SimpleREOptions -> String -> m RE
- Text.RE.PCRE.String: compileSearchReplace :: (Monad m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)
+ Text.RE.PCRE.String: compileSearchReplace :: (Monad m, MonadFail m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)
- Text.RE.PCRE.String: compileSearchReplaceWith :: (Monad m, Functor m, IsRegex RE s) => SimpleREOptions -> String -> String -> m (SearchReplace RE s)
+ Text.RE.PCRE.String: compileSearchReplaceWith :: (Monad m, MonadFail m, Functor m, IsRegex RE s) => SimpleREOptions -> String -> String -> m (SearchReplace RE s)
- Text.RE.PCRE.String: escape :: (Functor m, Monad m) => (String -> String) -> String -> m RE
+ Text.RE.PCRE.String: escape :: (Functor m, Monad m, MonadFail m) => (String -> String) -> String -> m RE
- Text.RE.PCRE.String: escapeWith :: (Functor m, Monad m) => SimpleREOptions -> (String -> String) -> String -> m RE
+ Text.RE.PCRE.String: escapeWith :: (Functor m, Monad m, MonadFail m) => SimpleREOptions -> (String -> String) -> String -> m RE
- Text.RE.PCRE.Text: (=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex Text a) => Text -> RE -> m a
+ Text.RE.PCRE.Text: (=~~) :: (Monad m, MonadFail m, Functor m, Typeable a, RegexContext Regex Text a) => Text -> RE -> m a
- Text.RE.PCRE.Text: compileRegex :: (Functor m, Monad m) => String -> m RE
+ Text.RE.PCRE.Text: compileRegex :: (Functor m, Monad m, MonadFail m) => String -> m RE
- Text.RE.PCRE.Text: compileRegexWith :: (Functor m, Monad m) => SimpleREOptions -> String -> m RE
+ Text.RE.PCRE.Text: compileRegexWith :: (Functor m, Monad m, MonadFail m) => SimpleREOptions -> String -> m RE
- Text.RE.PCRE.Text: compileSearchReplace :: (Monad m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)
+ Text.RE.PCRE.Text: compileSearchReplace :: (Monad m, MonadFail m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)
- Text.RE.PCRE.Text: compileSearchReplaceWith :: (Monad m, Functor m, IsRegex RE s) => SimpleREOptions -> String -> String -> m (SearchReplace RE s)
+ Text.RE.PCRE.Text: compileSearchReplaceWith :: (Monad m, MonadFail m, Functor m, IsRegex RE s) => SimpleREOptions -> String -> String -> m (SearchReplace RE s)
- Text.RE.PCRE.Text: escape :: (Functor m, Monad m) => (String -> String) -> String -> m RE
+ Text.RE.PCRE.Text: escape :: (Functor m, Monad m, MonadFail m) => (String -> String) -> String -> m RE
- Text.RE.PCRE.Text: escapeWith :: (Functor m, Monad m) => SimpleREOptions -> (String -> String) -> String -> m RE
+ Text.RE.PCRE.Text: escapeWith :: (Functor m, Monad m, MonadFail m) => SimpleREOptions -> (String -> String) -> String -> m RE
- Text.RE.PCRE.Text.Lazy: (=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex Text a) => Text -> RE -> m a
+ Text.RE.PCRE.Text.Lazy: (=~~) :: (Monad m, MonadFail m, Functor m, Typeable a, RegexContext Regex Text a) => Text -> RE -> m a
- Text.RE.PCRE.Text.Lazy: compileRegex :: (Functor m, Monad m) => String -> m RE
+ Text.RE.PCRE.Text.Lazy: compileRegex :: (Functor m, Monad m, MonadFail m) => String -> m RE
- Text.RE.PCRE.Text.Lazy: compileRegexWith :: (Functor m, Monad m) => SimpleREOptions -> String -> m RE
+ Text.RE.PCRE.Text.Lazy: compileRegexWith :: (Functor m, Monad m, MonadFail m) => SimpleREOptions -> String -> m RE
- Text.RE.PCRE.Text.Lazy: compileSearchReplace :: (Monad m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)
+ Text.RE.PCRE.Text.Lazy: compileSearchReplace :: (Monad m, MonadFail m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)
- Text.RE.PCRE.Text.Lazy: compileSearchReplaceWith :: (Monad m, Functor m, IsRegex RE s) => SimpleREOptions -> String -> String -> m (SearchReplace RE s)
+ Text.RE.PCRE.Text.Lazy: compileSearchReplaceWith :: (Monad m, MonadFail m, Functor m, IsRegex RE s) => SimpleREOptions -> String -> String -> m (SearchReplace RE s)
- Text.RE.PCRE.Text.Lazy: escape :: (Functor m, Monad m) => (String -> String) -> String -> m RE
+ Text.RE.PCRE.Text.Lazy: escape :: (Functor m, Monad m, MonadFail m) => (String -> String) -> String -> m RE
- Text.RE.PCRE.Text.Lazy: escapeWith :: (Functor m, Monad m) => SimpleREOptions -> (String -> String) -> String -> m RE
+ Text.RE.PCRE.Text.Lazy: escapeWith :: (Functor m, Monad m, MonadFail m) => SimpleREOptions -> (String -> String) -> String -> m RE

Files

README.md view
@@ -42,6 +42,7 @@ - [X] 2018-12-14  v1.0.1.4  [Fix for GHC 8.4.4, GHC-8.6.2](https://github.com/iconnect/regex/milestone/23) - [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)   See the [Roadmap page](http://roadmap.regex.uk) for details.
Text/RE/PCRE.hs view
@@ -4,7 +4,8 @@ #if __GLASGOW_HASKELL__ >= 800 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-} #endif-{-# OPTIONS_GHC -fno-warn-dodgy-exports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports         #-}+{-# OPTIONS_GHC -fno-warn-unused-imports        #-}  module Text.RE.PCRE   (@@ -111,6 +112,7 @@   , module Text.RE.PCRE.String   ) where +import           Control.Monad.Fail import           Text.RE.PCRE.ByteString() import           Text.RE.PCRE.ByteString.Lazy() import           Text.RE.PCRE.Sequence()@@ -176,7 +178,7 @@ (=~) bs rex = B.match (reRegex rex) bs  -- | the regex-base monadic, polymorphic match operator-(=~~) :: ( Monad m+(=~~) :: ( Monad m, MonadFail m          , B.RegexContext PCRE.Regex s a          , B.RegexMaker   PCRE.Regex PCRE.CompOption PCRE.ExecOption s          )
Text/RE/PCRE/ByteString.hs view
@@ -7,6 +7,7 @@ {-# LANGUAGE CPP                            #-} #if __GLASGOW_HASKELL__ >= 800 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}+{-# OPTIONS_GHC -fno-warn-unused-imports        #-} #endif  module Text.RE.PCRE.ByteString@@ -84,6 +85,7 @@   , module Text.RE.Tools.IsRegex   ) where +import           Control.Monad.Fail import qualified Data.ByteString               as B import           Data.Typeable import           Prelude.Compat@@ -146,7 +148,7 @@ (=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs  -- | the `regex-base` monadic, polymorphic match operator-(=~~) :: ( Monad m+(=~~) :: ( Monad m, MonadFail m          , Functor m          , Typeable a          , RegexContext PCRE.Regex B.ByteString a
Text/RE/PCRE/ByteString/Lazy.hs view
@@ -7,6 +7,7 @@ {-# LANGUAGE CPP                            #-} #if __GLASGOW_HASKELL__ >= 800 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}+{-# OPTIONS_GHC -fno-warn-unused-imports        #-} #endif  module Text.RE.PCRE.ByteString.Lazy@@ -84,6 +85,7 @@   , module Text.RE.Tools.IsRegex   ) where +import           Control.Monad.Fail import qualified Data.ByteString.Lazy          as LBS import           Data.Typeable import           Prelude.Compat@@ -146,7 +148,7 @@ (=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs  -- | the `regex-base` monadic, polymorphic match operator-(=~~) :: ( Monad m+(=~~) :: ( Monad m, MonadFail m          , Functor m          , Typeable a          , RegexContext PCRE.Regex LBS.ByteString a
Text/RE/PCRE/Sequence.hs view
@@ -7,6 +7,7 @@ {-# LANGUAGE CPP                            #-} #if __GLASGOW_HASKELL__ >= 800 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}+{-# OPTIONS_GHC -fno-warn-unused-imports        #-} #endif  module Text.RE.PCRE.Sequence@@ -84,6 +85,7 @@   , module Text.RE.Tools.IsRegex   ) where +import           Control.Monad.Fail import qualified Data.Sequence                 as S import           Data.Typeable import           Prelude.Compat@@ -146,7 +148,7 @@ (=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs  -- | the `regex-base` monadic, polymorphic match operator-(=~~) :: ( Monad m+(=~~) :: ( Monad m, MonadFail m          , Functor m          , Typeable a          , RegexContext PCRE.Regex (S.Seq Char) a
Text/RE/PCRE/String.hs view
@@ -7,6 +7,7 @@ {-# LANGUAGE CPP                            #-} #if __GLASGOW_HASKELL__ >= 800 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}+{-# OPTIONS_GHC -fno-warn-unused-imports        #-} #endif  module Text.RE.PCRE.String@@ -84,7 +85,7 @@   , module Text.RE.Tools.IsRegex   ) where -+import           Control.Monad.Fail import           Data.Typeable import           Prelude.Compat import           Text.RE.REOptions@@ -96,6 +97,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@@ -146,7 +148,7 @@ (=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs  -- | the `regex-base` monadic, polymorphic match operator-(=~~) :: ( Monad m+(=~~) :: ( Monad m, MonadFail m          , Functor m          , Typeable a          , RegexContext PCRE.Regex String a
Text/RE/PCRE/Text.hs view
@@ -7,6 +7,7 @@ {-# LANGUAGE CPP                            #-} #if __GLASGOW_HASKELL__ >= 800 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}+{-# OPTIONS_GHC -fno-warn-unused-imports        #-} #endif  module Text.RE.PCRE.Text@@ -84,6 +85,7 @@   , module Text.RE.Tools.IsRegex   ) where +import           Control.Monad.Fail import qualified Data.Text                     as T import           Data.Typeable import           Prelude.Compat@@ -146,7 +148,7 @@ (=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs  -- | the `regex-base` monadic, polymorphic match operator-(=~~) :: ( Monad m+(=~~) :: ( Monad m, MonadFail m          , Functor m          , Typeable a          , RegexContext PCRE.Regex T.Text a
Text/RE/PCRE/Text/Lazy.hs view
@@ -7,6 +7,7 @@ {-# LANGUAGE CPP                            #-} #if __GLASGOW_HASKELL__ >= 800 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}+{-# OPTIONS_GHC -fno-warn-unused-imports        #-} #endif  module Text.RE.PCRE.Text.Lazy@@ -84,6 +85,7 @@   , module Text.RE.Tools.IsRegex   ) where +import           Control.Monad.Fail import qualified Data.Text.Lazy                as TL import           Data.Typeable import           Prelude.Compat@@ -146,7 +148,7 @@ (=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs  -- | the `regex-base` monadic, polymorphic match operator-(=~~) :: ( Monad m+(=~~) :: ( Monad m, MonadFail m          , Functor m          , Typeable a          , RegexContext PCRE.Regex TL.Text a
Text/RE/ZeInternals/PCRE.hs view
@@ -12,7 +12,8 @@ {-# LANGUAGE QuasiQuotes                #-} {-# LANGUAGE TemplateHaskell            #-} #endif-{-# OPTIONS_GHC -fno-warn-orphans       #-}+{-# OPTIONS_GHC -fno-warn-orphans               #-}+{-# OPTIONS_GHC -fno-warn-unused-imports        #-}  module Text.RE.ZeInternals.PCRE   ( -- * About@@ -66,16 +67,18 @@   , cp   ) where +import           Control.Monad.Fail import           Data.Bits import           Data.Functor.Identity import           Language.Haskell.TH import           Language.Haskell.TH.Quote-import           Prelude.Compat+import           Prelude.Compat                   hiding (fail) import           Text.RE.REOptions import           Text.RE.Replace import           Text.RE.TestBench import           Text.RE.Tools import           Text.RE.ZeInternals+import           Text.RE.ZeInternals.Types.Poss import           Text.Regex.PCRE  @@ -184,17 +187,17 @@  -- | compile a 'String' into a 'RE' with the default options, -- generating an error if the RE is not well formed-compileRegex :: (Functor m,Monad m) => String -> m RE+compileRegex :: (Functor m,Monad m, MonadFail m) => String -> m RE compileRegex = compileRegexWith minBound  -- | compile a 'String' into a 'RE' using the given @SimpleREOptions@, -- generating an error if the RE is not well formed-compileRegexWith :: (Functor m,Monad m) => SimpleREOptions -> String -> m RE+compileRegexWith :: (Functor m,Monad m, MonadFail m) => SimpleREOptions -> String -> m RE compileRegexWith = compileRegexWithOptions  -- | compile a 'String' into a 'RE' using the given @SimpleREOptions@, -- generating an error if the RE is not well formed-compileRegexWithOptions :: (IsOption o, Functor m, Monad m)+compileRegexWithOptions :: (IsOption o, Functor m, Monad m, MonadFail m)                         => o                         -> String                         -> m RE@@ -207,7 +210,7 @@  -- | compile a SearchReplace template generating errors if the RE or -- the template are not well formed, all capture references being checked-compileSearchReplace :: (Monad m,Functor m,IsRegex RE s)+compileSearchReplace :: (Monad m,MonadFail m,Functor m,IsRegex RE s)                      => String                      -> String                      -> m (SearchReplace RE s)@@ -216,22 +219,22 @@ -- | compile a SearchReplace template, with simple options, generating -- errors if the RE or the template are not well formed, all capture -- references being checked-compileSearchReplaceWith :: (Monad m,Functor m,IsRegex RE s)+compileSearchReplaceWith :: (Monad m,MonadFail m,Functor m,IsRegex RE s)                          => SimpleREOptions                          -> String                          -> String                          -> m (SearchReplace RE s)-compileSearchReplaceWith sro = compileSearchAndReplace_ packR $ compileRegexWith sro+compileSearchReplaceWith sro = compileSearchAndReplace_ packR $ poss2either . compileRegexWith sro  -- | compile a SearchReplace template, with general options, generating -- errors if the RE or the template are not well formed, all capture -- references being checked-compileSearchReplaceWithOptions :: (Monad m,Functor m,IsRegex RE s)+compileSearchReplaceWithOptions :: (Monad m,MonadFail m,Functor m,IsRegex RE s)                                 => REOptions                                 -> String                                 -> String                                 -> m (SearchReplace RE s)-compileSearchReplaceWithOptions os = compileSearchAndReplace_ packR $ compileRegexWithOptions os+compileSearchReplaceWithOptions os = compileSearchAndReplace_ packR $ poss2either . compileRegexWithOptions os   ------------------------------------------------------------------------@@ -244,14 +247,14 @@ -- --  @maybe undefined id . escape ((\"^\"++) . (++\"$\"))@ ---escape :: (Functor m,Monad m)+escape :: (Functor m,Monad m, MonadFail m)        => (String->String)        -> String        -> m RE escape = escapeWith minBound  -- | a variant of 'escape' where the 'SimpleREOptions' are specified-escapeWith :: (Functor m,Monad m)+escapeWith :: (Functor m,Monad m, MonadFail m)            => SimpleREOptions            -> (String->String)            -> String@@ -260,7 +263,7 @@  -- | a variant of 'escapeWith' that allows an 'IsOption' RE option -- to be specified-escapeWithOptions :: ( IsOption o, Functor m, Monad   m)+escapeWithOptions :: ( IsOption o, Functor m, Monad m, MonadFail m)                   => o                   -> (String->String)                   -> String@@ -376,7 +379,7 @@       }   where     parse :: SimpleREOptions -> (String->Q Exp) -> String -> Q Exp-    parse sro mk rs = either error (\_->mk rs) $ compileRegex_ os rs+    parse sro mk rs = poss error (\_->mk rs) $ compileRegex_ os rs       where         os = unpackSimpleREOptions sro @@ -392,11 +395,11 @@ unsafeCompileRegex = unsafeCompileRegex_ . makeREOptions  unsafeCompileRegex_ :: REOptions -> String -> RE-unsafeCompileRegex_ os = either oops id . compileRegexWithOptions os+unsafeCompileRegex_ os = poss oops id . compileRegexWithOptions os   where     oops = error . ("unsafeCompileRegex: " ++) -compileRegex' :: (Functor m,Monad m)+compileRegex' :: (Functor m,Monad m,MonadFail m)               => REOptions               -> String               -> m (CaptureNames,Regex)@@ -406,7 +409,7 @@   where     s1 = expandMacros reSource optionsMacs s0 -compileRegex_ :: ( Functor m , Monad m )+compileRegex_ :: ( Functor m , Monad m, MonadFail m )               => REOptions               -> String               -> m RE
Text/RE/ZeInternals/SearchReplace/PCREEdPrime.hs view
@@ -21,6 +21,7 @@ import           Text.RE.Tools.IsRegex import           Text.RE.ZeInternals import           Text.RE.ZeInternals.PCRE+import           Text.RE.ZeInternals.Types.Poss   -- | construct a quasi quoter from a casting function and @Just sro@@@ -41,7 +42,7 @@     parse sro mk ts = either error (\_->mk ts) ei       where         ei :: Either String (SearchReplace RE String)-        ei = compileSearchReplace_ id (compileRegexWith sro) ts+        ei = poss2either $ compileSearchReplace_ id (poss2either . compileRegexWith sro) ts  unsafe_compile_sr_simple :: IsRegex RE s                          => SimpleREOptions@@ -55,4 +56,4 @@                      -> String                      -> SearchReplace RE s unsafe_compile_sr os =-    unsafeCompileSearchReplace_ packR $ compileRegexWithOptions os+    unsafeCompileSearchReplace_ packR $ poss2either . compileRegexWithOptions os
Text/RE/ZeInternals/SearchReplace/TDFAEdPrime.hs view
@@ -21,6 +21,7 @@ import           Text.RE.Tools.IsRegex import           Text.RE.ZeInternals import           Text.RE.ZeInternals.TDFA+import           Text.RE.ZeInternals.Types.Poss   -- | construct a quasi quoter from a casting function and @Just sro@@@ -41,7 +42,7 @@     parse sro mk ts = either error (\_->mk ts) ei       where         ei :: Either String (SearchReplace RE String)-        ei = compileSearchReplace_ id (compileRegexWith sro) ts+        ei = poss2either $ compileSearchReplace_ id (poss2either . compileRegexWith sro) ts  unsafe_compile_sr_simple :: IsRegex RE s                          => SimpleREOptions@@ -55,4 +56,4 @@                   -> String                   -> SearchReplace RE s unsafe_compile_sr os =-    unsafeCompileSearchReplace_ packR $ compileRegexWithOptionsForQQ os+    unsafeCompileSearchReplace_ packR $ poss2either . compileRegexWithOptionsForQQ os
Text/RE/ZeInternals/TDFA.hs view
@@ -12,7 +12,8 @@ {-# LANGUAGE QuasiQuotes                #-} {-# LANGUAGE TemplateHaskell            #-} #endif-{-# OPTIONS_GHC -fno-warn-orphans       #-}+{-# OPTIONS_GHC -fno-warn-orphans               #-}+{-# OPTIONS_GHC -fno-warn-unused-imports        #-}  module Text.RE.ZeInternals.TDFA   ( -- * About@@ -67,15 +68,17 @@   , cp   ) where +import           Control.Monad.Fail import           Data.Functor.Identity import           Language.Haskell.TH import           Language.Haskell.TH.Quote-import           Prelude.Compat+import           Prelude.Compat                       hiding (fail) import           Text.RE.REOptions import           Text.RE.Replace import           Text.RE.TestBench import           Text.RE.Tools import           Text.RE.ZeInternals+import           Text.RE.ZeInternals.Types.Poss import           Text.Regex.TDFA  @@ -181,17 +184,17 @@  -- | compile a 'String' into a 'RE' with the default options, -- generating an error if the RE is not well formed-compileRegex :: (Functor m,Monad m) => String -> m RE+compileRegex :: (Functor m,Monad m,MonadFail m) => String -> m RE compileRegex = compileRegexWith minBound  -- | compile a 'String' into a 'RE' using the given @SimpleREOptions@, -- generating an error if the RE is not well formed-compileRegexWith :: (Functor m,Monad m) => SimpleREOptions -> String -> m RE+compileRegexWith :: (Functor m,Monad m,MonadFail m) => SimpleREOptions -> String -> m RE compileRegexWith = compileRegexWithOptions  -- | compile a 'String' into a 'RE' using the given @SimpleREOptions@, -- generating an error if the RE is not well formed-compileRegexWithOptions :: (IsOption o, Functor m, Monad   m)+compileRegexWithOptions :: (IsOption o, Functor m, Monad   m, MonadFail m)                         => o                         -> String                         -> m RE@@ -199,7 +202,7 @@  -- | compile a 'String' into a 'RE' for q quasi quoter, using the given -- @SimpleREOptions@, generating an error if the RE is not well formed-compileRegexWithOptionsForQQ :: (IsOption o, Functor m, Monad   m)+compileRegexWithOptionsForQQ :: (IsOption o, Functor m, Monad   m,MonadFail m)                              => o                              -> String                              -> m RE@@ -212,7 +215,7 @@  -- | compile a SearchReplace template generating errors if the RE or -- the template are not well formed, all capture references being checked-compileSearchReplace :: (Monad m,Functor m,IsRegex RE s)+compileSearchReplace :: (Monad m,MonadFail m,Functor m,IsRegex RE s)                      => String                      -> String                      -> m (SearchReplace RE s)@@ -221,22 +224,22 @@ -- | compile a SearchReplace template, with simple options, generating -- errors if the RE or the template are not well formed, all capture -- references being checked-compileSearchReplaceWith :: (Monad m,Functor m,IsRegex RE s)+compileSearchReplaceWith :: (Monad m,MonadFail m,Functor m,IsRegex RE s)                          => SimpleREOptions                          -> String                          -> String                          -> m (SearchReplace RE s)-compileSearchReplaceWith sro = compileSearchAndReplace_ packR $ compileRegexWith sro+compileSearchReplaceWith sro = compileSearchAndReplace_ packR $ poss2either . compileRegexWith sro  -- | compile a SearchReplace template, with general options, generating -- errors if the RE or the template are not well formed, all capture -- references being checked-compileSearchReplaceWithOptions :: (Monad m,Functor m,IsRegex RE s)+compileSearchReplaceWithOptions :: (Monad m,MonadFail m,Functor m,IsRegex RE s)                                 => REOptions                                 -> String                                 -> String                                 -> m (SearchReplace RE s)-compileSearchReplaceWithOptions os = compileSearchAndReplace_ packR $ compileRegexWithOptions os+compileSearchReplaceWithOptions os = compileSearchAndReplace_ packR $ poss2either . compileRegexWithOptions os   ------------------------------------------------------------------------@@ -249,14 +252,14 @@ -- --  @maybe undefined id . escape ((\"^\"++) . (++\"$\"))@ ---escape :: (Functor m,Monad m)+escape :: (Functor m,Monad m,MonadFail m)        => (String->String)        -> String        -> m RE escape = escapeWith minBound  -- | a variant of 'escape' where the 'SimpleREOptions' are specified-escapeWith :: (Functor m,Monad m)+escapeWith :: (Functor m,Monad m,MonadFail m)            => SimpleREOptions            -> (String->String)            -> String@@ -265,7 +268,7 @@  -- | a variant of 'escapeWith' that allows an 'IsOption' RE option -- to be specified-escapeWithOptions :: ( IsOption o, Functor m, Monad m)+escapeWithOptions :: ( IsOption o, Functor m, Monad m,MonadFail m)                   => o                   -> (String->String)                   -> String@@ -382,7 +385,7 @@       }   where     parse :: SimpleREOptions -> (String->Q Exp) -> String -> Q Exp-    parse sro mk rs = either error (\_->mk rs) $ compileRegex_ RPM_qq os rs+    parse sro mk rs = poss error (\_->mk rs) $ compileRegex_ RPM_qq os rs       where         os = unpackSimpleREOptions sro @@ -403,11 +406,11 @@ unsafeCompileRegex = unsafeCompileRegex_ RPM_qq . makeREOptions  unsafeCompileRegex_ :: RegexParseMode -> REOptions -> String -> RE-unsafeCompileRegex_ rpm os = either oops id . compileRegex_ rpm os+unsafeCompileRegex_ rpm os = poss oops id . compileRegex_ rpm os   where     oops = error . ("unsafeCompileRegex: " ++) -compileRegex_ :: (Functor m,Monad m)+compileRegex_ :: (Functor m,MonadFail m,Monad m)               => RegexParseMode               -> REOptions               -> String@@ -422,7 +425,7 @@         , _re_regex   = rx         } -compileRegex' :: (Functor m,Monad m)+compileRegex' :: (Functor m,MonadFail m,Monad m)               => RegexParseMode               -> REOptions               -> String
changelog view
@@ -1,5 +1,9 @@ -*-change-log-*- +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)+ 1.0.2.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2018-12-19   * cabal-install build with 8.0 and 8.2 failing (#163)   * Switch to GHC-8.6.3/nightly-2018-12-19 (#164)
regex-with-pcre.cabal view
@@ -1,12 +1,12 @@ Name:                   regex-with-pcre-Version:                1.0.2.0+Version:                1.1.0.0 Synopsis:               Toolkit for regex-base Description:            A regular expression toolkit for regex-base with                         compile-time checking of RE syntax, data types for                         matches and captures, a text replacement toolkit,                         portable options, high-level AWK-like tools                         for building text processing apps, regular expression-                        macros with parsers and test bench, omprehensive+                        macros with parsers and test bench, comprehensive                         documentation, tutorials and copious examples. Homepage:               http://regex.uk Author:                 Chris Dornan@@ -32,7 +32,7 @@ Source-Repository this     Type:               git     Location:           https://github.com/iconnect/regex.git-    Tag:                1.0.2.0+    Tag:                1.1.0.0   @@ -96,17 +96,16 @@     Build-depends:         regex                       , base                 >= 4        && <  5-      , base-compat          >= 0.6-      , bytestring           == 0.10.*+      , base-compat          >= 0.6      && <  1+      , bytestring           >= 0.10       , containers           >= 0.4-      , regex-base           == 0.93.*-      , regex-pcre-builtin   == 0.94.*-      , regex-pcre-text      == 0.94.*-      , regex-tdfa           == 1.2.*+      , regex-base           >= 0.93+      , regex-pcre-builtin   >= 0.94+      , regex-tdfa           >= 1.2       , template-haskell     >= 2.7-      , text                 == 1.2.*+      , text                 >= 1.2       , transformers         >= 0.2.2-      , unordered-containers == 0.2.*+      , unordered-containers >= 0.2   -- Generated with re-gen-cabals