1 2 3 4 5 6 7 8
module Data.List.Extra where import Data.Maybe (listToMaybe) (!!?) :: [a] -> Int -> Maybe a x !!? i | i >= 0 = listToMaybe (drop i x) _ !!? _ = Nothing