articles icon indicating copy to clipboard operation
articles copied to clipboard

zipWith question: flip in rotateUntil

Open TysonMN opened this issue 3 years ago • 0 comments

This is a question about your zipWith article.

Is flip essential in

rotateUntil p xs = zipWith
    (flip const)
    xs
    (dropWhile (not . p) (cycle xs))

?

My guess is that this can be simplified to

rotateUntil p xs = zipWith
    const
    (dropWhile (not . p) (cycle xs))
    xs

Am I correct?

TysonMN avatar Aug 08 '22 11:08 TysonMN