Compose the three functions:
reverse :: [a] -> [a]
reverse = abs . rev . rep
The representation built by rep has constructors. rev preserves that count, and abs traverses it once. Their three linear bounds add to total time, improving the direct quadratic reversal. The correctness equations for representation, reversal and abstraction compose to the required reversed list.

Articles by others on the same topic (0)

There are currently no matching articles.