Open
Description
- replace the current
fn(A, B, C) -> D
type with anfn F(A, B, C) -> D
trait fn foo[T](x: X) -> Y { ... }
creates:- a unique type
fn foo[T]
const foo[T]: fn foo[T]
impl foo[T]: fn (fn foo[T])(X) -> D
- a unique type
fn
expressions create unique, unnameable type, with inherent implementation of the appropriatefn
trait- can add
+
/?
/*
suffix tofn
keyword to additionally implementFork
/Drop
(see vine:Fork
/Drop
#171)
- can add
- TBD: how, exactly, do
fn
impl items work?
fn map[T, U, F; F*, fn F(T) -> I](list: List[T], f: F) -> List[U] { ... }
struct MulBy(N32);
mod MulBy {
pub impl call: fn MulBy(N32) -> N32 {
fn call(MulBy(a): N32, b: N32) -> N32 {
a * b
}
}
}
fn curry_mul(a: N32) -> MulBy {
MulBy(a)
}
curry_mul(2)(23) // 46