Something went wrong. Try again.
The Monad language. Dependent types, functional programming compiled with LLVM. Hobby project. monad-lang.org
dependent-types language compiler programming-language functional-programming
Something went wrong. Try again.
123456789101112131415161718192021// List-specific extras beyond the core List type/constructors// (init/prelude.mo). Re-exported ambiently via init/lib.mo./// Get the element at indexdef List.get (index : I64) (l : List A) : Option A := // TODO fails to parse properly let b := index == 0 in if b then (match l { empty => none, cons a tail => some a }) else (let b2 := BOrd.gt index 0 in if b2 then match l { empty => none, cons a tail => List.get (index - 1) tail } else none)