Switch to smart constructor
This version switches the existing constructor to a smart constructor. This gets rid of the require
, which can throw exceptions. Using a smart constructor creating an Interval
returns an Option
. This makes needing to handle an unsuccessful creation very explicit.