module Data.List.Extra where import Data.Maybe (listToMaybe) (!!?) :: [a] -> Int -> Maybe a x !!? i | i >= 0 = listToMaybe (drop i x) _ !!? _ = Nothing