mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-24 12:14:26 +03:00
11 lines
136 B
Idris
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
|
|
|