Source codeContentsIndex
RegexChannel
Synopsis
data RegexChannel
newRegexChannel :: IO RegexChannel
sendString :: RegexChannel -> String -> Event ()
data RegularExpression
class HasRegularExpression ptn where
toRegularExpression :: ptn -> RegularExpression
matchEvent :: (HasRegularExpression ptn) => ptn -> RegexChannel -> Event String
matchAny :: RegexChannel -> Event String
matchEvent' :: (HasRegularExpression ptn) => ptn -> RegexChannel -> Event MatchResult
Documentation
data RegexChannel
A channel of Strings, which can be matched by regular expression
newRegexChannel :: IO RegexChannel
Create a new RegexChannel
sendString :: RegexChannel -> String -> Event ()
Send a String along a RegexChannel.
data RegularExpression
class HasRegularExpression ptn where

Class of things which may be converted to compiled regular expressions. This includes compiled regular expressions themselves and Strings. This allows the user to speed things up by precompiling regular expressions.

The syntax of the regular expressions themselves is summarised in the comments to the source file util/RegularExpression.hs

Methods
toRegularExpression :: ptn -> RegularExpression
Compiles the given regular expression.
Instances
HasRegularExpression RegularExpression
HasRegularExpression String
matchEvent :: (HasRegularExpression ptn) => ptn -> RegexChannel -> Event String
matchAny :: RegexChannel -> Event String
Makes Event accepting any String at all.
matchEvent' :: (HasRegularExpression ptn) => ptn -> RegexChannel -> Event MatchResult
Makes Event accepting Strings matching a particular pattern, but carrying the actual MatchResult, allowing for example for parts of the String matching parts of the regular expression to be returned.
Produced by Haddock version 0.3