We currently use an integer, which can only take values from 0..5. We should instead have the interval be represented with an enum, having the integer slot -> enum interval conversion be a constructor for it.
There are multiple places where we already match on the interval, and we should replace those with the new enum. Having the enum let's us type check these so any change to the intervals fails at compile time. It also documents the code better.
We currently use an integer, which can only take values from 0..5. We should instead have the interval be represented with an enum, having the integer slot -> enum interval conversion be a constructor for it.
There are multiple places where we already match on the interval, and we should replace those with the new enum. Having the enum let's us type check these so any change to the intervals fails at compile time. It also documents the code better.