‘some’ and ‘many’ functions from the ‘Alternative’ type class [duplicate]
some and many can be defined as: some f = (:) <$> f <*> many f many f = some f <|> pure [] Perhaps it helps to see how some would be written with monadic do syntax: some f = do x <- f xs <- many f return (x:xs) So some f runs … Read more