module Text.Regex.Do.Pcre.Utf8.MatchHint
(MatchHint(..),
(=~)) where
import Text.Regex.Do.Type.Do hiding (Once,All)
import Text.Regex.PCRE.Wrap()
import qualified Text.Regex.Do.Pcre.Utf8.Match as M
import Text.Regex.Do.Type.MatchHint
import Data.ByteString
class (Hint hint, M.Match enc a a (F hint a)) =>
MatchHint hint enc a where
type F hint a
match::hint (Pattern (enc a)) -> Body (enc a) -> F hint a
match h0 = M.match $ unhint h0
(=~)::MatchHint hint Utf8_ a =>
hint a
-> a
-> F hint a
(=~) h0 = (M.=~) $ unhint h0
instance MatchHint Test Utf8_ String where
type F Test String = Bool
instance MatchHint PosLen' Utf8_ String where
type F PosLen' String = [PosLen]
instance MatchHint PosLen_ Utf8_ String where
type F PosLen_ String = [[PosLen]]
instance MatchHint Once Utf8_ String where
type F Once String = [String]
instance MatchHint All Utf8_ String where
type F All String = [[String]]
instance MatchHint Test Utf8_ ByteString where
type F Test ByteString = Bool
instance MatchHint PosLen' Utf8_ ByteString where
type F PosLen' ByteString = [PosLen]
instance MatchHint PosLen_ Utf8_ ByteString where
type F PosLen_ ByteString = [[PosLen]]
instance MatchHint Once Utf8_ ByteString where
type F Once ByteString = [ByteString]
instance MatchHint All Utf8_ ByteString where
type F All ByteString = [[ByteString]]