Module ktn_lists

Function Index

delete_first/2Returns a copy of List deleting the first Element where Fun(Element) returns true, if there is such an element.
filter/3Like lists:filter/2 but allows specifying additional arguments.
map/3Like lists:map/2 but allows specifying additional arguments.
split_when/2Splits a list whenever an element satisfies the When predicate.

Function Details

delete_first/2

delete_first(Fun::fun((term()) -> boolean()), List::list()) -> list()

Returns a copy of List deleting the first Element where Fun(Element) returns true, if there is such an element.

filter/3

filter(Pred::function(), Args::list(), List::list()) -> list()

Like lists:filter/2 but allows specifying additional arguments. E.g. ktn_lists:filter(fun (X, Y) -> X * Y < 3 end, [2], [1, 2, 3]) = [2]

map/3

map(Fun::function(), Args::list(), Tail::list()) -> list()

Like lists:map/2 but allows specifying additional arguments. E.g. ktn_lists:map(fun (X, Y) -> X * Y end, [2], [1, 2, 3]) = [2, 4, 6]

split_when/2

split_when(When::function(), List::list()) -> list()

Splits a list whenever an element satisfies the When predicate. Returns a list of lists where each list includes the matched element as its last one. E.g. split_when(fun (X) -> $. == X end, "a.b.c") = ["a.", "b.", "c"]


Generated by EDoc