Implemented the circuit thing in typelevel, for fun.