This is the definition of List.pure added in #154:
let pure = Declaration("List.pure",
type: .Type => { A in A --> List.ref[A] },
value: () => { A, a in cons[A, a, `nil`[A]] })
Syntax notwithstanding, this is much like in a “real” language. However, since there are no implicit arguments, we always have to apply the type parameters explicitly in the values of functions. This is (apparently) unnecessary! We should be able to reduce that down to:
let pure = Declaration("List.pure",
type: () => { A in A --> List.ref[A] },
value: () => { a in cons[a, `nil`] })
Apparently, implicit arguments will allow this. I just have no idea how they work.
This is the definition of
List.pure
added in #154:Syntax notwithstanding, this is much like in a “real” language. However, since there are no implicit arguments, we always have to apply the type parameters explicitly in the values of functions. This is (apparently) unnecessary! We should be able to reduce that down to:
Apparently, implicit arguments will allow this. I just have no idea how they work.