Alternative, an extension of Applicative, declares empty, <|> and these two functions:
One or more:
some :: f a -> f [a]Zero or more:
many :: f a -> f [a]If defined,
someandmanyshould be the least solutions of the equations:some v = (:) <$> v <*> many v many v = some v <|> pure []
I couldn't find an instance for which some and many are defined. What is their meaning and practical use? Are they used at all? I've been unable to grasp their purpose just from this definition.
Update: I'm not asking what is Alternative, just what are some and many
I tend to see them in
Applicativeparser combinator libraries.and I see
manyused for purpose in the default definitions ofParsinginparsers.I think Parsec being the primary example of a parser combinator library hides the use of
some/manysince it redefines things like(<|>).