diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -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.
diff --git a/Text/RE/TDFA.hs b/Text/RE/TDFA.hs
--- a/Text/RE/TDFA.hs
+++ b/Text/RE/TDFA.hs
@@ -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.TDFA
   (
@@ -113,6 +114,7 @@
   , module Text.RE.TDFA.Text.Lazy
   ) where
 
+import           Control.Monad.Fail
 import           Text.RE.REOptions
 import           Text.RE.Replace
 import           Text.RE.TDFA.ByteString()
@@ -175,7 +177,7 @@
 (=~) bs rex = B.match (reRegex rex) bs
 
 -- | the regex-base monadic, polymorphic match operator
-(=~~) :: ( Monad m
+(=~~) :: ( Monad m, MonadFail m
          , B.RegexContext TDFA.Regex s a
          , B.RegexMaker   TDFA.Regex TDFA.CompOption TDFA.ExecOption s
          )
diff --git a/Text/RE/TDFA/ByteString.hs b/Text/RE/TDFA/ByteString.hs
--- a/Text/RE/TDFA/ByteString.hs
+++ b/Text/RE/TDFA/ByteString.hs
@@ -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.TDFA.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 TDFA.Regex B.ByteString a
diff --git a/Text/RE/TDFA/ByteString/Lazy.hs b/Text/RE/TDFA/ByteString/Lazy.hs
--- a/Text/RE/TDFA/ByteString/Lazy.hs
+++ b/Text/RE/TDFA/ByteString/Lazy.hs
@@ -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.TDFA.ByteString.Lazy
@@ -84,6 +85,7 @@
   , module Text.RE.Tools.IsRegex
   ) where
 
+import           Control.Monad.Fail
 import qualified Data.ByteString.Lazy.Char8    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 TDFA.Regex LBS.ByteString a
diff --git a/Text/RE/TDFA/Sequence.hs b/Text/RE/TDFA/Sequence.hs
--- a/Text/RE/TDFA/Sequence.hs
+++ b/Text/RE/TDFA/Sequence.hs
@@ -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.TDFA.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 TDFA.Regex (S.Seq Char) a
diff --git a/Text/RE/TDFA/String.hs b/Text/RE/TDFA/String.hs
--- a/Text/RE/TDFA/String.hs
+++ b/Text/RE/TDFA/String.hs
@@ -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.TDFA.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.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
@@ -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 TDFA.Regex String a
diff --git a/Text/RE/TDFA/Text.hs b/Text/RE/TDFA/Text.hs
--- a/Text/RE/TDFA/Text.hs
+++ b/Text/RE/TDFA/Text.hs
@@ -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.TDFA.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 TDFA.Regex T.Text a
diff --git a/Text/RE/TDFA/Text/Lazy.hs b/Text/RE/TDFA/Text/Lazy.hs
--- a/Text/RE/TDFA/Text/Lazy.hs
+++ b/Text/RE/TDFA/Text/Lazy.hs
@@ -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.TDFA.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 TDFA.Regex TL.Text a
diff --git a/Text/RE/ZeInternals/NamedCaptures.lhs b/Text/RE/ZeInternals/NamedCaptures.lhs
--- a/Text/RE/ZeInternals/NamedCaptures.lhs
+++ b/Text/RE/ZeInternals/NamedCaptures.lhs
@@ -33,6 +33,7 @@
 import           Text.RE.ZeInternals.Tools.Lex
 import           Text.RE.ZeInternals.Types.CaptureID
 import           Text.RE.ZeInternals.Types.Match
+import           Text.RE.ZeInternals.Types.Poss
 import           Text.Regex.TDFA
 
 
@@ -135,7 +136,7 @@
     s2c [c] = c
     s2c _   = oops "s2c"
 
-    mk s f  = (either error id $ makeRegexM s,Just . f)
+    mk s f  = (poss error id $ makeRegexM s,Just . f)
 
     oops  m = error $ "NamedCaptures.scan: " ++ m
 \end{code}
diff --git a/Text/RE/ZeInternals/SearchReplace.hs b/Text/RE/ZeInternals/SearchReplace.hs
--- a/Text/RE/ZeInternals/SearchReplace.hs
+++ b/Text/RE/ZeInternals/SearchReplace.hs
@@ -8,7 +8,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.SearchReplace
   ( unsafeCompileSearchReplace_
@@ -16,13 +17,15 @@
   , compileSearchAndReplace_
   ) where
 
+import           Control.Monad.Fail
 import qualified Data.HashMap.Strict            as HMS
-import           Prelude.Compat
+import           Prelude.Compat                           hiding (fail)
 import           Text.RE.ZeInternals.NamedCaptures
 import           Text.RE.ZeInternals.Replace
 import           Text.RE.ZeInternals.Types.Capture
 import           Text.RE.ZeInternals.Types.CaptureID
 import           Text.RE.ZeInternals.Types.Matches
+import           Text.RE.ZeInternals.Types.Poss
 import           Text.RE.ZeInternals.Types.SearchReplace
 import qualified Text.Regex.TDFA                as TDFA
 
@@ -33,27 +36,27 @@
                             -> (String->Either String re)
                             -> String
                             -> SearchReplace re s
-unsafeCompileSearchReplace_ pk cf = either err id . compileSearchReplace_ pk cf
+unsafeCompileSearchReplace_ pk cf = poss err id . compileSearchReplace_ pk cf
   where
     err msg = error $ "unsafeCompileSearchReplace_: " ++ msg
 
 -- | 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)
+compileSearchReplace_ :: (Monad m,MonadFail m,Functor m)
                       => (String->s)
                       -> (String->Either String re)
                       -> String
                       -> m (SearchReplace re s)
-compileSearchReplace_ pack compile_re sr_tpl = either fail return $ do
+compileSearchReplace_ pack compile_re sr_tpl = poss fail return $ do
     case mainCaptures $ sr_tpl $=~ "///" of
       [cap] ->
         compileSearchAndReplace_ pack compile_re
                       (capturePrefix cap) (captureSuffix cap)
-      _ -> Left $ "bad search-replace template syntax: " ++ sr_tpl
+      _ -> Eek $ "bad search-replace template syntax: " ++ sr_tpl
 
 -- | compile 'SearcgReplace' from two strings containing the RE
 -- and the replacement template
-compileSearchAndReplace_ :: (Monad m,Functor m)
+compileSearchAndReplace_ :: (Monad m,MonadFail m,Functor m)
                          => (String->s)
                          -> (String->Either String re)
                          -> String
diff --git a/Text/RE/ZeInternals/SearchReplace/TDFAEdPrime.hs b/Text/RE/ZeInternals/SearchReplace/TDFAEdPrime.hs
--- a/Text/RE/ZeInternals/SearchReplace/TDFAEdPrime.hs
+++ b/Text/RE/ZeInternals/SearchReplace/TDFAEdPrime.hs
@@ -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
diff --git a/Text/RE/ZeInternals/TDFA.hs b/Text/RE/ZeInternals/TDFA.hs
--- a/Text/RE/ZeInternals/TDFA.hs
+++ b/Text/RE/ZeInternals/TDFA.hs
@@ -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
diff --git a/Text/RE/ZeInternals/Types/IsRegex.lhs b/Text/RE/ZeInternals/Types/IsRegex.lhs
--- a/Text/RE/ZeInternals/Types/IsRegex.lhs
+++ b/Text/RE/ZeInternals/Types/IsRegex.lhs
@@ -5,6 +5,7 @@
 {-# LANGUAGE CPP                        #-}
 #if __GLASGOW_HASKELL__ >= 800
 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
+{-# OPTIONS_GHC -fno-warn-unused-imports        #-}
 #endif
 
 module Text.RE.ZeInternals.Types.IsRegex
@@ -14,6 +15,7 @@
   , searchReplaceFirst
   ) where
 
+import           Control.Monad.Fail
 import           Text.RE.REOptions
 import           Text.RE.Replace
 import           Text.RE.ZeInternals.EscapeREString
@@ -29,17 +31,17 @@
   -- | finding all matches
   matchMany             :: re -> s -> Matches s
   -- | compiling an RE, failing if the RE is not well formed
-  makeRegex             :: (Functor m,Monad m) => s -> m re
+  makeRegex             :: (Functor m,Monad m, MonadFail m) => s -> m re
   -- | comiling an RE, specifying the 'SimpleREOptions'
-  makeRegexWith         :: (Functor m,Monad m) => SimpleREOptions -> s -> m re
+  makeRegexWith         :: (Functor m,Monad m, MonadFail m) => SimpleREOptions -> s -> m re
   -- | compiling a 'SearchReplace' template from the RE text and the template Text, failing if they are not well formed
-  makeSearchReplace     :: (Functor m,Monad m,IsRegex re s) => s -> s -> m (SearchReplace re s)
+  makeSearchReplace     :: (Functor m,Monad m, MonadFail m,IsRegex re s) => s -> s -> m (SearchReplace re s)
   -- | compiling a 'SearchReplace' template specifing the 'SimpleREOptions' for the RE
-  makeSearchReplaceWith :: (Functor m,Monad m,IsRegex re s) => SimpleREOptions -> s -> s -> m (SearchReplace re s)
+  makeSearchReplaceWith :: (Functor m,Monad m, MonadFail m,IsRegex re s) => SimpleREOptions -> s -> s -> m (SearchReplace re s)
   -- | incorporate an escaped string into a compiled RE with the default options
-  makeEscaped           :: (Functor m,Monad m) => (s->s) -> s -> m re
+  makeEscaped           :: (Functor m,Monad m, MonadFail m) => (s->s) -> s -> m re
   -- | incorporate an escaped string into a compiled RE with the specified 'SimpleREOptions'
-  makeEscapedWith       :: (Functor m,Monad m) => SimpleREOptions -> (s->s) -> s -> m re
+  makeEscapedWith       :: (Functor m,Monad m, MonadFail m) => SimpleREOptions -> (s->s) -> s -> m re
   -- | extract the text of the RE from the RE
   regexSource           :: re -> s
 
diff --git a/Text/RE/ZeInternals/Types/Poss.hs b/Text/RE/ZeInternals/Types/Poss.hs
new file mode 100644
--- /dev/null
+++ b/Text/RE/ZeInternals/Types/Poss.hs
@@ -0,0 +1,41 @@
+{-# OPTIONS_GHC -fno-warn-unused-imports    #-}
+
+module Text.RE.ZeInternals.Types.Poss where
+
+import           Control.Monad.Fail
+
+
+data Poss a
+  = Eek String
+  | Yup a
+  deriving (Eq,Ord,Show)
+
+instance Functor Poss where
+  fmap f p = case p of
+    Eek m -> Eek m
+    Yup x -> Yup $ f x
+
+instance Applicative Poss where
+  pure        = Yup
+  (<*>) p1 p2 = case p1 of
+    Eek m -> Eek m
+    Yup f -> case p2 of
+      Eek n -> Eek n
+      Yup x -> Yup $ f x
+
+instance Monad Poss where
+  return = pure
+  (>>=) p f = case p of
+    Eek m -> Eek m
+    Yup x -> f x
+
+instance MonadFail Poss where
+  fail = Eek
+
+poss :: (String->b) -> (a->b) -> Poss a -> b
+poss f _ (Eek s) = f s
+poss _ g (Yup x) = g x
+
+poss2either :: Poss a -> Either String a
+poss2either (Eek m) = Left  m
+poss2either (Yup x) = Right x
diff --git a/Text/RE/ZeInternals/Types/SearchReplace.lhs b/Text/RE/ZeInternals/Types/SearchReplace.lhs
--- a/Text/RE/ZeInternals/Types/SearchReplace.lhs
+++ b/Text/RE/ZeInternals/Types/SearchReplace.lhs
@@ -2,6 +2,7 @@
 module Text.RE.ZeInternals.Types.SearchReplace
   ( SearchReplace(..)
   ) where
+
 \end{code}
 
 \begin{code}
diff --git a/changelog b/changelog
--- a/changelog
+++ b/changelog
@@ -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)
diff --git a/regex.cabal b/regex.cabal
--- a/regex.cabal
+++ b/regex.cabal
@@ -1,12 +1,12 @@
 Name:                   regex
-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
 
 
 
@@ -60,6 +60,7 @@
       Text.RE.Tools.Lex
       Text.RE.Tools.Sed
       Text.RE.ZeInternals
+      Text.RE.ZeInternals.Types.Poss
 
     Other-Modules:
       Text.RE.ZeInternals.AddCaptureNames
@@ -125,20 +126,19 @@
     Build-depends:
         array                >= 0.4
       , base                 >= 4        && <  5
-      , base-compat          >= 0.6
-      , bytestring           == 0.10.*
+      , base-compat          >= 0.6      && <  1
+      , bytestring           >= 0.10
       , containers           >= 0.4
-      , hashable             == 1.2.*
-      , regex-base           == 0.93.*
-      , regex-pcre-builtin   == 0.94.*
-      , regex-tdfa           == 1.2.*
-      , regex-tdfa-text      == 1.0.*
+      , hashable             >= 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
       , time                 >= 1.4.2
-      , time-locale-compat   == 0.1.*
+      , time-locale-compat   >= 0.1
       , transformers         >= 0.2.2
-      , unordered-containers == 0.2.*
+      , unordered-containers >= 0.2
       , utf8-string          >= 1
 
 
