MutableList
Concatenating
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>;}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>;}Constructors
Creates an empty MutableList.
Signature
declare function empty<A = never>(): MutableList<A>fromIterable
Added in v2.0.0
Source
Creates a new MutableList from an iterable collection of values.
Signature
declare function fromIterable<A>(iterable: Iterable<A>): MutableList<A>Creates a new MutableList from the specified elements.
Signature
declare function make<A>(...elements: readonly Array<A>): MutableList<A>Getters
Returns the first element of the list, if it exists.
Signature
declare function head<A>(self: MutableList<A>): A | undefinedReturns true if the list contains zero elements, false, otherwise.
Signature
declare function isEmpty<A>(self: MutableList<A>): booleanReturns the length of the list.
Signature
declare function length<A>(self: MutableList<A>): numberReturns the last element of the list, if it exists.
Signature
declare function tail<A>(self: MutableList<A>): A | undefinedModel
MutableList interface
Added in v2.0.0
Source
Signature
interface MutableList<out A> extends Iterable<A>, Pipeable, Inspectable { readonly [TypeId]: typeof TypeId;}Other
Removes the last value from the list and returns it, if it exists.
Signature
declare function pop<A>(self: MutableList<A>): A | undefinedRemoves all elements from the doubly-linked list.
Signature
declare function reset<A>(self: MutableList<A>): MutableList<A>Removes the first value from the list and returns it, if it exists.
Signature
declare function shift<A>(self: MutableList<A>): A | undefined