Created
September 3, 2018 12:04
-
-
Save ZeekoZhu/ea2bb97e442986b2881dbe3889d33bac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eval = (\char reducer fn -> String.split char >> List.map (String.trim >> fn) >> List.foldr reducer (if char == "+" || char == "-" then 0 else 1)) |> \op -> (String.toFloat >> Maybe.withDefault 0) |> op "*" (*) |> op "/" (/) |> op "-" (-) |> op "+" (+) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment