Is your feature request related to a problem? Please describe.
I find myself writing these functions when making use of the array iteration functions such as Mapped and Filtered.
Describe the solution you'd like
I suggest to have functions in the library for Identity<'T>(a), EqualsX(a, b), NotEqualsX(a, b), where X in I, B, D, and L.
Here is an example how these functions can be used for retrieving all bits in an integer that are 1 in their binary expansion:
function IntegerBits(val : Int, bits : Int) : Int[] {
let id = Id<(Int, Bool)>;
let pred = Compose(EqualsB(_, true), Snd<Int, Bool>);
return Mapped(Fst<Int, Bool>, Filtered(pred, MappedByIndex(id, IntAsBoolArray(val, bits))));
}
Describe alternatives you've considered
Writing the functions as local private functions.
Additional context
N/A