| Copyright | (c) Fumiaki Kinoshita 2015 |
|---|---|
| License | BSD3 |
| Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Extensible.Match
Description
Pattern matching
- matchWith :: (forall x. f x -> g x -> r) -> (f :* xs) -> (g :| xs) -> r
- newtype Match h a x = Match {
- runMatch :: h x -> a
- _Match :: (Profunctor p, Functor f) => p (g x -> a) (f (h y -> b)) -> p (Match g a x) (f (Match h b y))
- match :: (Match h a :* xs) -> (h :| xs) -> a
- mapMatch :: (a -> b) -> Match h a x -> Match h b x
- caseOf :: (h :| xs) -> (Match h a :* xs) -> a
Documentation
matchWith :: (forall x. f x -> g x -> r) -> (f :* xs) -> (g :| xs) -> r Source
Retrieve the contents so that they matches and pass both to the given function.
Turn a wrapper type into one clause that returns a.