fix issue 9942 - Add a functional switch function

std.algorithm.predSwitch is the functional version of the `switch`
statement(without a lookup table).
Merge pull request #1259 from idanarye/add-a-functional-switch-function

fix issue 9942 - Add a functional switch function