Sanitize IR

Only CI for now.
Any reason you did not write this as a `foldLeft`?