Functional Implementation of the String Calculator