Tuple1<T1> extension

Extension methods on Record with 1 positional element.

on
  • (T1)

Properties

first → T1
Returns the first element of this tuple.
no setter
iterable Iterable
An (untyped) Iterable over the values of this tuple.
no setter
last → T1
Returns the last element of this tuple.
no setter
length int
Returns the number of elements in the tuple.
no setter

Methods

addFirst<T>(T value) → (T, T1)
Returns a new tuple with value added at the first position.
addLast<T>(T value) → (T1, T)
Returns a new tuple with value added at the last position.
addSecond<T>(T value) → (T1, T)
Returns a new tuple with value added at the second position.
map<R>(R callback(T1 first)) → R
Applies the values of this tuple to an 1-ary function.
removeFirst() → ()
Returns a new tuple with the first element removed.
removeLast() → ()
Returns a new tuple with the last element removed.
toList() List
An (untyped) List with the values of this tuple.
toSet() Set
An (untyped) Set with the unique values of this tuple.
withFirst<T>(T value) → (T)
Returns a new tuple with the first element replaced by value.
withLast<T>(T value) → (T)
Returns a new tuple with the last element replaced by value.

Static Methods

fromList<T>(List<T> list) → (T)
List constructor.