-- TODO: check for underflow/overflow
safeAdjust :: Rounding -> Double -> SafeValue h a -> Maybe (SafeValue h a)
safeAdjust RoundUp   d (Value x) = Just $ Value $ ceiling (d * fromIntegral x)
safeAdjust :: Rounding -> Double -> SafeValue h a -> Maybe (SafeValue h a)
safeAdjust RoundUp   d (Value x) = Just $ Value $ ceiling (d * fromIntegral x)
safeAdjust RoundUp   d (Value x) = Just $ Value $ ceiling (d * fromIntegral x)