-- For Strings.
-- | Given a string and a range, return either Just the string converted to an Int if it is in
--   range, or Nothing.
sToIntRange :: String -> [Int] -> Maybe Int
sToIntRange str range
    | val `elem` mRange = val
    | otherwise         = Nothing
    where val    = readMaybe str
          mRange = map Just range
sToIntRange :: String -> [Int] -> Maybe Int
sToIntRange str range
    | val `elem` mRange = val
    | otherwise         = Nothing
    where val    = readMaybe str
          mRange = map Just range
sToIntRange str range
    | val `elem` mRange = val
    | otherwise         = Nothing
    where val    = readMaybe str
          mRange = map Just range