arborium-idris 2.4.5

Idris grammar for arborium (tree-sitter bindings)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module Main

data Vect : Nat -> Type -> Type where
    Nil  : Vect Z a
    (::) : a -> Vect n a -> Vect (S n) a

append : Vect n a -> Vect m a -> Vect (n + m) a
append Nil       ys = ys
append (x :: xs) ys = x :: append xs ys

total
head : Vect (S n) a -> a
head (x :: _) = x

main : IO ()
main = printLn (head [1, 2, 3])