It might be a bit off-topic, but if you want to ease the syntaxic pain only, you can use the pa_openin ( http://alain.frisch.fr/soft.html#openin ) camlp4 extension : open Graph in { g with nodes = foo }