MCPcopy
hub / github.com/Effect-TS/effect / reverse

Function reverse

packages/effect/src/List.ts:869–877  ·  view source on GitHub ↗
(self: List<A>)

Source from the content-addressed store, hash-verified

867 * @category elements
868 */
869export const reverse = <A>(self: List<A>): List<A> => {
870 let result = empty<A>()
871 let these = self
872 while (!isNil(these)) {
873 result = prepend(result, these.head)
874 these = these.tail
875 }
876 return result
877}
878
879/**
880 * Splits the specified list into two lists at the specified index.

Callers 2

List.tsFile · 0.70
reverseChunkFunction · 0.70

Calls 2

isNilFunction · 0.85
emptyFunction · 0.70

Tested by

no test coverage detected