Add Runes and LlamaKit using Carthage
Footlessparser is using operators for map ( <^> ), flatmap/bind ( >>- ) and apply ( <*> ). Luckily the Runes framework has already defined these, and implemented them for optionals and arrays.
Each parse returns a
Result, which has either a tuple containing the output and the remaining unparsed part of the input, or an error description if parsing fails. The
Result enum is in the Llamakit framework, later replaced by antitypical/Result.
To implement the operators mentioned above for parsers it is very helpful to first implement them for what parsers return, i.e.
Result. Gordon Fontenot did just that in this pull request to Runes. It was never merged, so it’s included here.
Rename Runes+Result.swift to Result+Operators.swift
I renamed the file later to make the name more descriptive and not so foreign for those who have not heard about the Runes framework.
Switch from LlamaKit/LlamaKit to antitypical/Result.
failurefunctions for making a
Resultmoved to the
Resulttype and became static instead of global. Which is good, functions only involved with one type should be defined in that type.
Resultbecame a struct, not an enum. Which seems strange as it is either a success or a failure, never both. It was made back into an enum later.
Resultframework brought with it the micro frameworks
Preludehas some basic functional programming functionality that will come in handy.