many1 should return NonEmptyList
Closed this issue · 3 comments
no-longer-on-githu-b commented
This makes the image closer to the codomain and is therefore easier and safer to use. Especially useful with the common use case of using foldl1 or foldr1 on the result.
newlandsvalley commented
Also the other combinators that parse one or more values - many1Till, sepBy1 etc. I have a prototype implementation - https://github.com/newlandsvalley/purescript-school-of-music/blob/master/src/Data/Euterpea/DSL/ParserExtensions.purs. Does backward compatibility prevent the direct replacement? Incidentally, I couldn't find foldr1 in Pursuit although foldl1 was there.
hdgarrood commented
This was indeed fixed by #41, thanks @justinwoo