<|> -package:appar

An associative binary operation
This combinator implements choice. The parser p <|> q first applies p. If it succeeds, the value of p is returned. If p fails without consuming any input, parser q is tried. This combinator is defined equal to the mplus member of the MonadPlus class and the (<|>) member of Alternative. The parser is called predictive since q is only tried when parser p didn't consume any input (i.e.. the look ahead is 1). This non-backtracking behaviour allows for both an efficient implementation of the parser combinators and the generation of good error messages.
This combinator implements choice. The parser p <|> q first applies p. If it succeeds, the value of p is returned. If p fails without consuming any input, parser q is tried. This combinator is defined equal to the mplus member of the MonadPlus class and the (<|>) member of Alternative. The parser is called predictive since q is only tried when parser p didn't consume any input (i.e.. the look ahead is 1). This non-backtracking behaviour allows for both an efficient implementation of the parser combinators and the generation of good error messages.
Combines two images horizontally. This is an alias for horizJoin. infixr 5
Horizontally join two matrices. Visually:
( A ) <|> ( B ) = ( A | B )
Where both matrices A and B have the same number of rows. This condition is not checked.
An associative binary operation
Choose between two policies. If the first fails, run the second.
Nondeterministically choose between two computations.
(m <|> n) >>= k = (m >>= k) <|> (n >>= k)
(m <|> n) <|> o = m <|> (n <|> o)
empty <|> m = m
m <|> empty = m
Provide alternative layouts of the same content. Invariant: both arguments must flatten to the same document.
First try the left parser, if that fails try the right. | If both fail, the error will come from the right one.
Choose between two parsers. If the first parser fails, try the second one, but if the first one throws an error, propagate the error. This operation can arbitrarily backtrack. Note: this exported operator has different fixity than the same operator in Applicative. Hide this operator if you want to use the Alternative version.
Choose between two parsers. If the first parser fails, try the second one, but if the first one throws an error, propagate the error. This operation can arbitrarily backtrack. Note: this exported operator has different fixity than the same operator in Applicative. Hide this operator if you want to use the Alternative version.
Horizontally join two matrices. Visually:
( A ) <|> ( B ) = ( A | B )
Same as the usual <|> except a Format is no Functor, let alone Alternative.
Compose two documents, separating them by a new line. The new line is not inserted if either document is empty.
(|>) a value onto the target of a Lens into your Monad's state and return the result. When you do not need the result of the operation, (|>=) is more flexible.
(|>) a value onto the target of a Lens and return the result. When you do not need the result of the operation, (|>~) is more flexible.
(|>) a value onto the target of a Lens into your Monad's state and return the old result. When you do not need the result of the operation, (|>=) is more flexible.
(|>) a value onto the target of a Lens and return the old result. When you do not need the result of the operation, (|>~) is more flexible.
Union of two APIs, first takes precedence in case of overlap. Example:
>>> :{
type MyApi = "books" :> Get '[JSON] [Book] -- GET /books
:<|> "books" :> ReqBody '[JSON] Book :> Post '[JSON] () -- POST /books
:}