Safe Haskell | None |
---|---|
Language | Haskell2010 |
Pattern-matching expressions.
Synopsis
- matchAll :: Matcher m a => a -> m -> [MatchClause a m b] -> [b]
- match :: Matcher m a => a -> m -> [MatchClause a m b] -> b
- matchAllDFS :: Matcher m a => a -> m -> [MatchClause a m b] -> [b]
- matchDFS :: Matcher m a => a -> m -> [MatchClause a m b] -> b
Documentation
matchAll :: Matcher m a => a -> m -> [MatchClause a m b] -> [b] Source #
matchAll
takes a target, a matcher, and a list of match clauses.
matchAll
collects all the pattern-matching results and returns a list of the results evaluating the body expression for each pattern-matching result.
matchAll
traverses a search tree for pattern matching in breadth-first order.
match :: Matcher m a => a -> m -> [MatchClause a m b] -> b Source #
match
takes a target, a matcher, and a list of match clauses.
match
calculates only the first pattern-matching result and returns the results evaluating the body expression for the first pattern-matching result.
match
traverses a search tree for pattern matching in breadth-first order.
matchAllDFS :: Matcher m a => a -> m -> [MatchClause a m b] -> [b] Source #
matchAllDFS
is much similar to matchAll
but traverses a search tree for pattern matching in depth-first order.
matchDFS :: Matcher m a => a -> m -> [MatchClause a m b] -> b Source #
matchDFS
is much similar to match
but traverses a search tree for pattern matching in depth-first order.