| 1 |
\begin{code} |
| 2 |
module Text.RE.ZeInternals.Types.SearchReplace |
| 3 |
( SearchReplace(..) |
| 4 |
) where |
| 5 |
|
| 6 |
\end{code} |
| 7 |
|
| 8 |
\begin{code} |
| 9 |
-- | contains a compiled RE and replacement template |
| 10 |
data SearchReplace re s = |
| 11 |
SearchReplace |
| 12 |
{ getSearch :: !re -- ^ the RE to match a string to replace |
| 13 |
, getTemplate :: !s -- ^ the replacement template with ${cap} |
| 14 |
-- used to identify a capture (by number or |
| 15 |
-- name if one was given) and '$$' being |
| 16 |
-- used to escape a single '$' |
| 17 |
} |
| 18 |
deriving (Show) |
| 19 |
\end{code} |
| 20 |
|
| 21 |
\begin{code} |
| 22 |
instance Functor (SearchReplace re) where |
| 23 |
fmap f (SearchReplace re x) = SearchReplace re (f x) |
| 24 |
\end{code} |