some is:exact
One or more.
Examples
>>> some (putStr "la")
lalalalalalalalala... * goes on forever *
>>> some Nothing
nothing
>>> take 5 <$> some (Just 1)
* hangs forever *
Note that this function can be used with Parsers based on
Applicatives. In that case
some parser will attempt to parse
parser one or more times until it fails.
protolude Protolude,
parser-combinators Control.Applicative.Combinators,
parsers Text.Parser.Combinators,
rio RIO.Prelude,
base-prelude BasePrelude,
graphviz Data.GraphViz.Parsing,
turtle Turtle,
classy-prelude ClassyPrelude,
Cabal-syntax Distribution.Compat.Parsing Distribution.Compat.Prelude,
simple-cmd-args SimpleCmdArgs,
effectful-core Effectful.NonDet,
universum Universum.Applicative,
ihaskell IHaskellPrelude,
foundation Foundation.Parser,
rebase Rebase.Prelude,
flatparse FlatParse.Basic FlatParse.Stateful,
threepenny-gui Graphics.UI.Threepenny.Core,
configuration-tools Configuration.Utils.CommandLine,
list-transformer List.Transformer,
incipit-base Incipit.Base,
opt-env-conf OptEnvConf OptEnvConf.Parser,
cabal-install-solver Distribution.Solver.Compat.Prelude,
appar Text.Appar.ByteString Text.Appar.LazyByteString Text.Appar.String,
frisby Text.Parsers.Frisby One or more.
some p applies the parser
p one or
more times and returns a list of the values returned by
p.
word = some letter
some p applies the parser
p one or
more times and returns a list of the values returned by
p.
word = some letter
some p applies the parser
p one or
more times and returns a list of the values returned by
p.
word = some letter
Existential type: Some
This library defines an existential type
Some.
data Some f where
Some :: f a -> Some f
in few variants, and utilities to work with it.
If you are unsure which variant to use, use the one in
Data.Some module.
Deprecated: Renamed as just.
Deprecated: Renamed as just.
Collect one or more parses. Apply the supplied parser repeatedly on
the input stream and push the parse results to a downstream fold.
Stops: when the downstream fold stops or the parser fails. Fails: if
it stops without producing a single result.
>>> some p f = Parser.manyP p (Parser.takeGE 1 f)
>>> some = Parser.countBetween 1 maxBound
Compare with
some.
Choose a value that satisfies the given predicate. This is Hillbert's
choice, essentially. Note that if the predicate given is not
satisfiable (for instance const sFalse), then the element
returned will be arbitrary. The only guarantee is that if there's at
least one element that satisfies the predicate, then the returned
element will be one of those that do. The returned element is not
guaranteed to be unique, least, greatest etc, unless there happens to
be exactly one satisfying element.
Build a
Some c from some thing that satisfies
c.