Even and odd original positions become consecutive new positions:An occurrence at belongs to
evens :: Seq a -> Seq a
evens s v = map (`div` 2) (filter even (s v))
odds :: Seq a -> Seq a
odds s v = map (`div` 2) (filter odd (s v))evens at position ; one at belongs to odds at position . Thus the formulas preserve increasing position order and produce the specified finite examples. For infinite occurrence lists, filtering can search forever when no further position of the chosen parity exists. Consequently these otherwise direct formulas need not preserve productivity for every query. Articles by others on the same topic
There are currently no matching articles.