inRange :: Range -> Double -> Bool
inRange (minVal, maxVal) val
  | minVal <= maxVal = val >= minVal && val <= maxVal
  | otherwise        = val >= minVal || val <= maxVal
inRange :: Range -> Double -> Bool
inRange (minVal, maxVal) val
  | minVal <= maxVal = val >= minVal && val <= maxVal
  | otherwise        = val >= minVal || val <= maxVal
inRange (minVal, maxVal) val
  | minVal <= maxVal = val >= minVal && val <= maxVal
  | otherwise        = val >= minVal || val <= maxVal