Safe Haskell | None |
---|---|
Language | Haskell2010 |
this module uses TypeFamilies
this module is similar to Text.Regex.Do.Pcre.Match. The differences are:
Text.Regex.Do.Pcre.Match is more flexible:
accepts Pattern
Regex,
accepts Pattern
and Body
of different types
Text.Regex.Do.Pcre.Match needs to infer result type
in this module the result type is determined by the hint
Documentation
class (Hint hint, Match a a (F hint a)) => MatchHint hint a where Source
picks Match
instance where Pattern
and Body
are of the same type
Hint
and inferrable Pattern
or Body
type determine the instance
handy when working with OverloadedStrings
, in other cases when compiler needs a hint
>>>
Test ("в"::ByteString) =~ "тихо в лесу"
True
>>>
Once ("^all"::String) =~ "all the time"
["all"]
>>>
PosLen' ("и"::String) =~ "бывает и хуже"
[(13,2)]
Nothing
match :: hint (Pattern a) -> Body a -> F hint a Source
:: hint a | hint & pattern |
-> a | body |
-> F hint a | type defined by the instance, determined by the hint |