mirror of
https://github.com/ilyakooo0/Idris-dev.git
synced 2024-11-11 03:34:13 +03:00
16 lines
230 B
Idris
16 lines
230 B
Idris
|
module badbangop
|
||
|
|
||
|
-- Check that using "!" by itself as an operator does not work
|
||
|
|
||
|
infixl 2 !
|
||
|
|
||
|
(!) : List a -> Nat -> Maybe a
|
||
|
xs ! n = index' n xs
|
||
|
|
||
|
aList : List Integer
|
||
|
aList = [1,2,3,4,5]
|
||
|
|
||
|
opUse : Maybe Integer
|
||
|
opUse = aList ! 2
|
||
|
|