| Copyright | (C) 2026 - Eitan Chatav |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Eitan Chatav <eitan.chatav@gmail.com> |
| Stability | provisional |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Profunctor.Separator
Contents
Description
Synopsis
- data SepBy p = SepBy {
- beginBy :: p
- endBy :: p
- separateBy :: p
- sepBy :: Applicative p => p () -> SepBy (p ())
- noSep :: Applicative p => SepBy (p ())
- sepWith :: (Applicative p, TerminalSymbol c (p ())) => [c] -> SepBy (p ())
- beginWith :: TerminalSymbol c p => [c] -> SepBy p -> SepBy p
- endWith :: TerminalSymbol c p => [c] -> SepBy p -> SepBy p
- several :: (IsList s, IsList t, Distributor p) => SepBy (p () ()) -> p (Item s) (Item t) -> p s t
- several1 :: (IsList s, IsList t, Distributor p, Choice p) => SepBy (p () ()) -> p (Item s) (Item t) -> p s t
- chain :: Alternator p => (forall x. x -> Either x x) -> APartialIso a b (a, a) (b, b) -> APrism a b () () -> SepBy (p () ()) -> p a b -> p a b
- chain1 :: (Distributor p, Choice p) => (forall x. x -> Either x x) -> APartialIso a b (a, a) (b, b) -> SepBy (p () ()) -> p a b -> p a b
- intercalateP :: (Monoidal p, Choice p, AsEmpty s, Cons s s a a) => Int -> SepBy (p () ()) -> p a a -> p s s
SepBy
Used to sequence multiple times,
separated by a separateBy,
begun by a beginBy,
and ended by an endBy.
Constructors
| SepBy | |
Fields
| |
Instances
| Foldable SepBy Source # | |
Defined in Data.Profunctor.Separator Methods fold :: Monoid m => SepBy m -> m # foldMap :: Monoid m => (a -> m) -> SepBy a -> m # foldMap' :: Monoid m => (a -> m) -> SepBy a -> m # foldr :: (a -> b -> b) -> b -> SepBy a -> b # foldr' :: (a -> b -> b) -> b -> SepBy a -> b # foldl :: (b -> a -> b) -> b -> SepBy a -> b # foldl' :: (b -> a -> b) -> b -> SepBy a -> b # foldr1 :: (a -> a -> a) -> SepBy a -> a # foldl1 :: (a -> a -> a) -> SepBy a -> a # elem :: Eq a => a -> SepBy a -> Bool # maximum :: Ord a => SepBy a -> a # minimum :: Ord a => SepBy a -> a # | |
| Traversable SepBy Source # | |
| Functor SepBy Source # | |
| Read p => Read (SepBy p) Source # | |
| Show p => Show (SepBy p) Source # | |
| Eq p => Eq (SepBy p) Source # | |
| Ord p => Ord (SepBy p) Source # | |
Defined in Data.Profunctor.Separator | |
sepBy :: Applicative p => p () -> SepBy (p ()) Source #
A SepBy smart constructor,
setting the separateBy field.
Beginning and ending delimitors will be no-ops,
except by modifier record updates beginBy or endBy.
noSep :: Applicative p => SepBy (p ()) Source #
A SepBy smart constructor for no separator,
beginning or ending delimiters.
sepWith :: (Applicative p, TerminalSymbol c (p ())) => [c] -> SepBy (p ()) Source #
SepBy Combinators
several :: (IsList s, IsList t, Distributor p) => SepBy (p () ()) -> p (Item s) (Item t) -> p s t Source #
several noSep = manyP
several1 :: (IsList s, IsList t, Distributor p, Choice p) => SepBy (p () ()) -> p (Item s) (Item t) -> p s t Source #
several1 noSep = someP
Arguments
| :: Alternator p | |
| => (forall x. x -> Either x x) | |
| -> APartialIso a b (a, a) (b, b) | binary constructor pattern |
| -> APrism a b () () | nilary constructor pattern |
| -> SepBy (p () ()) | |
| -> p a b | |
| -> p a b |
Use a nilary constructor pattern to sequence zero times, or associate a binary constructor pattern to sequence one or more times.
Arguments
| :: (Distributor p, Choice p) | |
| => (forall x. x -> Either x x) | |
| -> APartialIso a b (a, a) (b, b) | binary constructor pattern |
| -> SepBy (p () ()) | |
| -> p a b | |
| -> p a b |
Associate a binary constructor pattern to sequence one or more times.
Arguments
| :: (Monoidal p, Choice p, AsEmpty s, Cons s s a a) | |
| => Int | number of repetitions |
| -> SepBy (p () ()) | |
| -> p a a | |
| -> p s s |
Add a SepBy to replicateP using intercalateP.