This would be useful when we need to make decision only based on whether the scientific it's floating point or integer. Especially when warn-type-defaults is on, we can write
if isFloating s then d else i
instead of
either (const d) (const i) (floatingOrInteger s :: Either Double Integer)
or
case floatingOrInteger s of
Left (_ :: Double) -> d
Right (_ :: Integer) -> i
This would be useful when we need to make decision only based on whether the scientific it's floating point or integer. Especially when
warn-type-defaults
is on, we can writeinstead of
or