parser-combinators-1.3.0: Lightweight package providing commonly useful parser combinators
Copyright © 2017–present Alex Washburn
License BSD 3 clause
Maintainer Mark Karpov <markkarpov92@gmail.com>
Stability experimental
Portability portable
Safe Haskell Safe-Inferred
Language Haskell2010

Control.Monad.Permutations

Description

This module specialized the interface to Monad for potential efficiency considerations, depending on the monad the permutations are run over.

For a more general interface requiring only Applicative , and for more complete documentation, see the Permutations module.

Since: 1.3.0

Synopsis

Permutation type

Permutation evaluators

runPermutation Source #

Arguments

:: ( Alternative m, Monad m)
=> Permutation m a

Permutation specification

-> m a

Resulting base monad capable of handling the permutation

"Unlifts" a permutation parser into a parser to be evaluated.

intercalateEffect Source #

Arguments

:: ( Alternative m, Monad m)
=> m b

Effect to be intercalated between permutation components

-> Permutation m a

Permutation specification

-> m a

Resulting base monad capable of handling the permutation

"Unlifts" a permutation parser into a parser to be evaluated with an intercalated effect. Useful for separators between permutation elements.

Permutation constructors

toPermutation Source #

Arguments

:: Alternative m
=> m a

Permutation component

-> Permutation m a

"Lifts" a parser to a permutation parser.

toPermutationWithDefault Source #

Arguments

:: Alternative m
=> a

Default Value

-> m a

Permutation component

-> Permutation m a

"Lifts" a parser with a default value to a permutation parser.

If no permutation containing the supplied parser can be parsed from the input, then the supplied default value is returned in lieu of a parse result.