To stop having to pass this around, adding this to the repo.
FYI @gligorov, @adudziak
Also @rquaglia note that this version is actually also ported to the functional framework (thanks to @sponce) so you should use this one instead of what I previously send around ;)