module Misc where infixl 3 !? (!?) :: [a] -> Int -> Maybe a [] !? i = Nothing (x:xs) !? 0 = Just x (x:xs) !? n = xs !? (n-1)