def List.set

Base · base.bend:1001

import Base
1001def List.set(a, -A: Kind(a), xs: List<a, A>, n: Nat, x: A) -> List<a, A>:
1002  match xs n:
1003    case Nil{} _:
1004      Nil{}
1005    case h <> t 0n:
1006      x <> t
1007    case h <> t 1n+p:
1008      h <> List.set(a, A, t, p, x)

Uses (2)

Used by (96)