2 ms·
I didn't wrote that ADTs are the same as boolean, only that optional types (Maybe/Option) are the same. For 2 reasons: 1. the 2-case, so it will be harder to
by nivertech 3y ago
I didn't wrote that ADTs are the same as boolean, only that optional types (Maybe/Option) are the same.
For 2 reasons:
1. the 2-case, so it will be harder to refactor once you add additional cases
2. they're missing domain/context/intent (Why value is missing?)
So, Maybe/Option is an improvement over null/nil and boolean flags, and ADTs/FSMs are improvement over Maybe-s.