packages feed

regex-0.0.0.1: Text/RE/Internal/AddCaptureNames.hs

module Text.RE.Internal.AddCaptureNames where

import           Text.RE


addCaptureNamesToMatches :: CaptureNames -> Matches a -> Matches a
addCaptureNamesToMatches cnms mtchs =
  mtchs { allMatches = map (addCaptureNamesToMatch cnms) $ allMatches mtchs }

addCaptureNamesToMatch :: CaptureNames -> Match a -> Match a
addCaptureNamesToMatch cnms mtch = mtch { captureNames = cnms }