regex-do-2.4: PCRE wrapper

Safe HaskellNone
LanguageHaskell2010

Text.Regex.Do.Pcre.MatchHint

Description

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

Synopsis

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)]

Minimal complete definition

Nothing

Associated Types

type F hint a Source

Methods

match :: hint (Pattern a) -> Body a -> F hint a Source

(=~) Source

Arguments

:: hint a

hint & pattern

-> a

body

-> F hint a

type defined by the instance, determined by the hint