Fix a tricky specialiser loop
This MR fixes a rather tricky bug in the specialiser, which made it generate code that loops.
There's a second patch that does a bit of orthogonal refactoring.
This MR fixes a rather tricky bug in the specialiser, which made it generate code that loops.
There's a second patch that does a bit of orthogonal refactoring.