Common functions that are useful for any type
Static methods
static_n<A, B>(value:A, input:B):B
An extension that always returns some input and drops the original value
69._n("nice") == "nice";staticinlinediscardWithPos<A>(_:A, ?pos:Null<PosInfos>):Void
An extension that drops its value and position info into a Void
staticinlineidentity<A>(a:A):A
A function that always returns its input unchanged
Some(123).map(identity) == Some(123);staticinlinekeyFor<K, V>(key:K, value:V):KeyValuePair<K, V>
Composable way to create a Key/Value pair
123.keyFor("abc") == { key: 123, value: "abc" };staticinlinekeyedWith<K, V>(value:V, key:K):KeyValuePair<K, V>
Composable way to create a Key/Value pair
"abc".keyedWith(123) == { key: 123, value: "abc" };staticinlinelet<T, K>(v:T, transformer:T ‑> K):K
Fluent method for transforming a value
Similar to map but for any value
123.let(Std.string) == "123";staticinlinemut<T>(v:T, mutator:T ‑> Void):T
Fluent method for mutating a value or whatever else
Similar to mutate but for any value
staticv_<A, B>(value:A, input:B):A
An extension that always returns the original value and drops any input
69.v_("nice") == 69;