Related: https://github.com/AndrasKovacs/elaboration-zoo

This is a great resource to learn how normalization by evaluation and insertion and solving of implicit variables is implemented.