    {-# LANGUAGE CPP                        #-}
    #if __GLASGOW_HASKELL__ >= 800
    {-# LANGUAGE TemplateHaskellQuotes      #-}
    #else
    {-# LANGUAGE QuasiQuotes                #-}
    {-# LANGUAGE TemplateHaskell            #-}
    #endif

    module Text.RE.ZeInternals.SearchReplace.TDFA.Text.Lazy
      ( ed
      , edMultilineSensitive
      , edMultilineInsensitive
      , edBlockSensitive
      , edBlockInsensitive
      , edMS
      , edMI
      , edBS
      , edBI
      , ed_
      ) where

    import qualified Data.Text.Lazy                as TL
    import           Language.Haskell.TH
    import           Language.Haskell.TH.Quote
    import           Text.RE.REOptions
    import           Text.RE.Tools.IsRegex
    import           Text.RE.ZeInternals.SearchReplace.TDFAEdPrime
    import           Text.RE.ZeInternals.TDFA

    -- | @[ed| ... \/\/\/ ... |]@, is equivalent to @[edMultilineSensitive| ... \/\/\/ ... |]@,
    -- compiling a case-sensitive, multi-line 'SearchReplace'
    ed                      :: QuasiQuoter
    ed :: QuasiQuoter
    ed                       = Q Exp -> Maybe SimpleREOptions -> QuasiQuoter
    ed' Q Exp
    sr_cast (Maybe SimpleREOptions -> QuasiQuoter)
    -> Maybe SimpleREOptions -> QuasiQuoter
    forall a b. (a -> b) -> a -> b
    $ SimpleREOptions -> Maybe SimpleREOptions
    forall a. a -> Maybe a
    Just SimpleREOptions
    forall a. Bounded a => a
    minBound

    -- | @[edMultilineSensitive| ... \/\/\/ ... |]@ compiles a case-sensitive, multi-line 'SearchReplace' template
    edMultilineSensitive    :: QuasiQuoter
    edMultilineSensitive :: QuasiQuoter
    edMultilineSensitive     = Q Exp -> Maybe SimpleREOptions -> QuasiQuoter
    ed' Q Exp
    sr_cast (Maybe SimpleREOptions -> QuasiQuoter)
    -> Maybe SimpleREOptions -> QuasiQuoter
    forall a b. (a -> b) -> a -> b
    $ SimpleREOptions -> Maybe SimpleREOptions
    forall a. a -> Maybe a
    Just  SimpleREOptions
    MultilineSensitive

    -- | @[edMultilineInsensitive| ... \/\/\/ ... |]@ compiles a case-insensitive, multi-line 'SearchReplace' template
    edMultilineInsensitive  :: QuasiQuoter
    edMultilineInsensitive :: QuasiQuoter
    edMultilineInsensitive   = Q Exp -> Maybe SimpleREOptions -> QuasiQuoter
    ed' Q Exp
    sr_cast (Maybe SimpleREOptions -> QuasiQuoter)
    -> Maybe SimpleREOptions -> QuasiQuoter
    forall a b. (a -> b) -> a -> b
    $ SimpleREOptions -> Maybe SimpleREOptions
    forall a. a -> Maybe a
    Just  SimpleREOptions
    MultilineInsensitive

    -- | @[edBlockSensitive| ... \/\/\/ ... |]@ compiles a case-sensitive, non-multi-line 'SearchReplace' template
    edBlockSensitive        :: QuasiQuoter
    edBlockSensitive :: QuasiQuoter
    edBlockSensitive         = Q Exp -> Maybe SimpleREOptions -> QuasiQuoter
    ed' Q Exp
    sr_cast (Maybe SimpleREOptions -> QuasiQuoter)
    -> Maybe SimpleREOptions -> QuasiQuoter
    forall a b. (a -> b) -> a -> b
    $ SimpleREOptions -> Maybe SimpleREOptions
    forall a. a -> Maybe a
    Just  SimpleREOptions
    BlockSensitive

    -- | @[edBlockInsensitive| ... \/\/\/ ... |]@ compiles a case-insensitive, non-multi-line 'SearchReplace' template
    edBlockInsensitive      :: QuasiQuoter
    edBlockInsensitive :: QuasiQuoter
    edBlockInsensitive       = Q Exp -> Maybe SimpleREOptions -> QuasiQuoter
    ed' Q Exp
    sr_cast (Maybe SimpleREOptions -> QuasiQuoter)
    -> Maybe SimpleREOptions -> QuasiQuoter
    forall a b. (a -> b) -> a -> b
    $ SimpleREOptions -> Maybe SimpleREOptions
    forall a. a -> Maybe a
    Just  SimpleREOptions
    BlockInsensitive

    -- | @[edMS| ... \/\/\/ ... |]@ is a shorthand for @[edMultilineSensitive| ... \/\/\/ ... |]@
    edMS                    :: QuasiQuoter
    edMS :: QuasiQuoter
    edMS                     = QuasiQuoter
    edMultilineSensitive

    -- | @[edMI| ... \/\/\/ ... |]@ is a shorthand for @[edMultilineInsensitive| ... \/\/\/ ... |]@
    edMI                    :: QuasiQuoter
    edMI :: QuasiQuoter
    edMI                     = QuasiQuoter
    edMultilineInsensitive

    -- | @[edBS| ... \/\/\/ ... |]@ is a shorthand for @[edBlockSensitive| ... \/\/\/ ... |]@
    edBS                    :: QuasiQuoter
    edBS :: QuasiQuoter
    edBS                     = QuasiQuoter
    edBlockSensitive

    -- | @[edBI| ... \/\/\/ ... |]@ is a shorthand for @[edBlockInsensitive| ... \/\/\/ ... |]@
    edBI                    :: QuasiQuoter
    edBI :: QuasiQuoter
    edBI                     = QuasiQuoter
    edBlockInsensitive

    -- | @[ed_| ... \/\/\/ ... |]@ compiles a 'SearchReplace' template to produce a function that
    -- takes the RE options (e.g., a 'SimpleREOptions' value) and yields the
    -- 'SearchReplace' template compiled with those options. For example,
    --
    --   @s *=~/ [ed_|${hex}([0-9a-f]+)\/\/\/0x${hex}|] MultilineInsensitive@
    --
    -- prefixes the hexadecimal digit strings in s with @0x@, allowing for
    -- upper- or lower-case hex digits (which is entirely equivalent
    -- in this example to just using @[edMultilineInsensitive|[0-9a-f]+|]@).
    ed_                     :: QuasiQuoter
    ed_ :: QuasiQuoter
    ed_                      = Q Exp -> Maybe SimpleREOptions -> QuasiQuoter
    ed' Q Exp
    fn_cast   Maybe SimpleREOptions
    forall a. Maybe a
    Nothing

    sr_cast :: Q Exp
    sr_cast :: Q Exp
    sr_cast = [|\x -> x :: SearchReplace RE TL.Text|]

    fn_cast :: Q Exp
    fn_cast :: Q Exp
    fn_cast = [|\f x -> f x :: SearchReplace RE TL.Text|]