haskell - Implementing skipWhile1 in attoparsec -


attoparsec provides function takewhile1 consumes @ least 1 character.

however, there no analog skipwhile. how can implement function skipwhile1?

note: question intentionally shows no research effort answered q&a-style.

another possible implementation:

import control.applicative  skipwhile1 p = skip p *> skipwhile p 

this might faster @uli's answer because takewhile builds result string, whereas skipwhile doesn't. laziness might make them equivalent (ie. maybe takewhile doesn't build string if don't use it); can't test @ moment verify this.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -