Did this a little while ago (as a stepping stone to building an inference system for a more complicated calculus).
https://gist.github.com/jrslepak/6158954
Did this a little while ago (as a stepping stone to building an inference system for a more complicated calculus).
https://gist.github.com/jrslepak/6158954