Skip to main content Link Search Menu Expand Document (external link)

MutableList.ts overview

Since v2.0.0


Exports Grouped by Category


concatenating

append

Appends the specified element to the end of the MutableList.

Signature

declare const append: {
  <A>(value: A): (self: MutableList<A>) => MutableList<A>
  <A>(self: MutableList<A>, value: A): MutableList<A>
}

Source

Since v2.0.0

prepend

Prepends the specified value to the beginning of the list.

Signature

declare const prepend: {
  <A>(value: A): (self: MutableList<A>) => MutableList<A>
  <A>(self: MutableList<A>, value: A): MutableList<A>
}

Source

Since v2.0.0

constructors

empty

Creates an empty MutableList.

Signature

declare const empty: <A>() => MutableList<A>

Source

Since v2.0.0

fromIterable

Creates a new MutableList from an iterable collection of values.

Signature

declare const fromIterable: <A>(iterable: Iterable<A>) => MutableList<A>

Source

Since v2.0.0

make

Creates a new MutableList from the specified elements.

Signature

declare const make: <A>(...elements: ReadonlyArray<A>) => MutableList<A>

Source

Since v2.0.0

getters

Returns the first element of the list, if it exists.

Signature

declare const head: <A>(self: MutableList<A>) => A | undefined

Source

Since v2.0.0

isEmpty

Returns true if the list contains zero elements, false, otherwise.

Signature

declare const isEmpty: <A>(self: MutableList<A>) => boolean

Source

Since v2.0.0

length

Returns the length of the list.

Signature

declare const length: <A>(self: MutableList<A>) => number

Source

Since v2.0.0

tail

Returns the last element of the list, if it exists.

Signature

declare const tail: <A>(self: MutableList<A>) => A | undefined

Source

Since v2.0.0

model

MutableList (interface)

Signature

export interface MutableList<out A> extends Iterable<A>, Pipeable, Inspectable {
  readonly [TypeId]: TypeId

  /** @internal */
  head: LinkedListNode<A> | undefined
  /** @internal */
  tail: LinkedListNode<A> | undefined
}

Source

Since v2.0.0

symbol

TypeId (type alias)

Signature

type TypeId = typeof TypeId

Source

Since v2.0.0

traversing

forEach

Executes the specified function f for each element in the list.

Signature

declare const forEach: {
  <A>(f: (element: A) => void): (self: MutableList<A>) => void
  <A>(self: MutableList<A>, f: (element: A) => void): void
}

Source

Since v2.0.0

utils

pop

Removes the last value from the list and returns it, if it exists.

Signature

declare const pop: <A>(self: MutableList<A>) => A | undefined

Source

Since v0.0.1

reset

Removes all elements from the doubly-linked list.

Signature

declare const reset: <A>(self: MutableList<A>) => MutableList<A>

Source

Since v2.0.0

shift

Removes the first value from the list and returns it, if it exists.

Signature

declare const shift: <A>(self: MutableList<A>) => A | undefined

Source

Since v0.0.1