Created simple functional pattern matching construct.