regex-do-2.6.1: PCRE wrapper

Safe HaskellNone
LanguageHaskell2010

Text.Regex.Do.Pcre.Ascii.MatchHint

Description

this module uses TypeFamilies

this module is similar to Text.Regex.Do.Pcre.Ascii.Match. The differences are:

this module:

  • Pattern and Body are of the same type
  • Hint and inferrable Pattern or Body type determine the instance

    the result type is determined by the hint

  • handy when working with OverloadedStrings, in other cases when compiler needs a hint

Synopsis

Documentation

class (Hint hint, Match a a (F hint a)) => MatchHint hint a where Source

Minimal complete definition

Nothing

Associated Types

type F hint a Source

Methods

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

Instances

MatchHint PosLen_ String Source 
MatchHint PosLen_ ByteString Source 
MatchHint PosLen' String Source
>>> PosLen' ("и"::String) =~ "бывает и хуже"

[(13,2)]

MatchHint PosLen' ByteString Source 
MatchHint All String Source 
MatchHint All ByteString Source 
MatchHint Once String Source
>>> Once ("^all"::String) =~ "all the time"

["all"]

MatchHint Once ByteString Source 
MatchHint Test String Source 
MatchHint Test ByteString Source
>>> Test ("в"::ByteString) =~ "тихо в лесу"

True

(=~) Source

Arguments

:: MatchHint hint a 
=> hint a

hint & pattern

-> a

body

-> F hint a

type defined by the instance, determined by the hint