-- Safe list indexing
(?!) :: [a] -> Int -> Maybe a
(?!) = \case
  []     -> pure Nothing
  a : as -> \case
    0         -> Just a
    n | n > 0 -> as ?! pred n
    _         -> Nothing
(?!) :: [a] -> Int -> Maybe a
(?!) = \case
  []     -> pure Nothing
  a : as -> \case
    0         -> Just a
    n | n > 0 -> as ?! pred n
    _         -> Nothing
(?!) = \case
  []     -> pure Nothing
  a : as -> \case
    0         -> Just a
    n | n > 0 -> as ?! pred n
    _         -> Nothing