B>, q: Parser<A>) -> Parser<B> { return p >>- { f in f <^> q } } // Sequence actions, discarding the value of the second argument func <* <A, B>(p: Parser<A>, q: Parser<B>) -> Parser<A> { return const <^> p <*> q } // Sequence actions, discarding the value of the first argument func *> <A, B>(p: Parser<A>, q: Parser<B>) -> Parser<B> { return const(id) <^> p <*> q }
Simple, readable, and easy to create your own parsers • Caveats • Needs performance improvements • FromJSON / ToJSON doesn't work in some nested structure • Swift 3 (with higher kinded types support) will surely solve this problem!