Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Match b = Match (forall r. r -> (b -> r) -> r)
- type Pat a b = a -> Match b
- (|||) :: Pat a b -> Pat a b -> Pat a b
- (&&&) :: Pat a b -> Pat a c -> Pat a (b, c)
- (~>) :: Pat a b -> (b -> c) -> Pat a c
- (~~>) :: Pat a b -> c -> Pat a c
- (<~) :: (a -> b) -> Pat b c -> Pat a c
- __ :: Pat a a
- succeed :: a -> Pat x a
- checkThat :: (a -> Bool) -> Pat a ()
- lit :: Eq a => a -> Pat a ()
- matchDefault :: a -> Match a -> a
- match :: Match a -> a
- matchMaybe :: Match a -> Maybe a
- list :: [Pat a b] -> Pat [a] [b]
- (><) :: Pat a b -> Pat x y -> Pat (a, x) (b, y)
- class Matches thing pats res | pats -> thing res where
Documentation
Match (forall r. r -> (b -> r) -> r) |
(&&&) :: Pat a b -> Pat a c -> Pat a (b, c) Source #
Check that a value satisfies multiple patterns.
For example, an "as" pattern is (__ &&& p)
.
matchDefault :: a -> Match a -> a Source #
Match a pattern, using the given default if valure.
matchMaybe :: Match a -> Maybe a Source #
class Matches thing pats res | pats -> thing res where Source #
Instances
(f ~ Pat a a1', a1 ~ Pat a1' r1) => Matches a (f, a1) r1 Source # | |
Defined in Cryptol.Utils.Patterns | |
(op ~ Pat a (a1', a2'), a1 ~ Pat a1' r1, a2 ~ Pat a2' r2) => Matches a (op, a1, a2) (r1, r2) Source # | |
Defined in Cryptol.Utils.Patterns | |
(op ~ Pat a (a1', a2', a3'), a1 ~ Pat a1' r1, a2 ~ Pat a2' r2, a3 ~ Pat a3' r3) => Matches a (op, a1, a2, a3) (r1, r2, r3) Source # | |
Defined in Cryptol.Utils.Patterns |