Idris2/tests/idris2/misc/import009/Infix.idr
2023-09-07 14:57:22 +01:00

11 lines
136 B
Idris

module Infix
export
infix 6 !!
(!!) : List a -> Nat -> Maybe a
[] !! _ = Nothing
(x :: _) !! Z = Just x
(_ :: xs) !! (S n) = xs !! n