Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active March 30, 2017 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/9cea5108a6c11839482ff2bc2e8773e0 to your computer and use it in GitHub Desktop.
Save deque-blog/9cea5108a6c11839482ff2bc2e8773e0 to your computer and use it in GitHub Desktop.
template<typename Out, typename Algebra>
Out para(Algebra f, expression const& ast)
{
return f(
fmap(
[f](expression const& e) -> std::pair<Out, expression const*> {
return { para<Out>(f, e), &e };
},
ast.get()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment