harp-0.4.3.4: HaRP allows pattern-matching with regular expressions

Copyright | (c) Niklas Broberg 2004
License | BSD-style (see the file LICENSE.txt)
Maintainer | Niklas Broberg, d00nibro@dtek.chalmers.se
Stability | experimental
Portability | portable
Safe Haskell | Safe
Language | Haskell2010

Harp.Match

Description

Functions that simulate the behavior of regular patterns using a Match monad for parsing lists.

Synopsis

- data Match e a
- runMatch :: Match e a -> [e] -> Maybe a
- baseMatch :: (a -> Maybe b) -> Match a (a, b)
- manyMatch :: Match e a -> Match e [a]
- gManyMatch :: Match e a -> Match e [a]
- foldComp :: [[a] -> [a]] -> [a] -> [a]
- unzip0 :: [()] -> ()
- unzip1 :: [a] -> [a]
- unzip2 :: [(a, b)] -> ([a], [b])
- unzip3 :: [(a, b, c)] -> ([a], [b], [c])
- unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
- unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
- unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
- unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
- (+++) :: Match e a -> Match e a -> Match e a

# Documentation

data Match e a Source #

The Match monad

#### Instances

Instances details

Monad (Match e) Source # |
Instance details Defined in Harp.Match Methods (>>=) :: Match e a -> (a -> Match e b) -> Match e b (>>) :: Match e a -> Match e b -> Match e b return :: a -> Match e a
Functor (Match e) Source # |
Instance details Defined in Harp.Match Methods fmap :: (a -> b) -> Match e a -> Match e b (<$) :: a -> Match e b -> Match e a
Applicative (Match e) Source # |
Instance details Defined in Harp.Match Methods pure :: a -> Match e a (<*>) :: Match e (a -> b) -> Match e a -> Match e b liftA2 :: (a -> b -> c) -> Match e a -> Match e b -> Match e c (*>) :: Match e a -> Match e b -> Match e b (<*) :: Match e a -> Match e b -> Match e a

runMatch :: Match e a -> [e] -> Maybe a Source #

baseMatch :: (a -> Maybe b) -> Match a (a, b) Source #

manyMatch :: Match e a -> Match e [a] Source #

gManyMatch :: Match e a -> Match e [a] Source #

foldComp :: [[a] -> [a]] -> [a] -> [a] Source #

unzip0 :: [()] -> () Source #

unzip1 :: [a] -> [a] Source #

unzip2 :: [(a, b)] -> ([a], [b]) Source #

unzip3 :: [(a, b, c)] -> ([a], [b], [c]) #

unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d]) #

unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e]) #

unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f]) #

unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g]) #

(+++) :: Match e a -> Match e a -> Match e a Source #