Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
var leafDecoder = map2(Leaf, field('name', string), field('value', int));
var branchDecoder = map2(
field('name', string),
field('children', list(decoder))
var decoder = oneOf([
lazy(function (_) { return branchDecoder; }),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment