List.get: def of Base
Import: import Base
Lines 992-999 of Base/base.bend: https://jend.leeeet.dev/read.txt?path=Base/base.bend&start_line=992&end_line=999
import Base
def List.get(a, -A: Kind(a), xs: List, n: Nat) -> Maybe:
match xs n:
case Nil{} _:
None{}
case h <> t 0n:
Some{h}
case h <> t 1n+p:
List.get(a, A, t, p)
Uses (3):
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat