Takes a unary function that is called on front of range if it is there
import optional: some, none; assert((int[]).init.withFront!(a => a * a) == none); assert([3, 2].withFront!(a => a * a) == some(9)); assert([3, 2].withFront!"a + 1" == some(4));
See Implementation
- 0.0.1
Takes a unary function that is called on front of range if it is there