Change Closure hierarchy.
This commit is contained in:
parent
9cec999cb9
commit
68de104595
@ -1,5 +1,5 @@
|
|||||||
pub hkt Functor[Self<T>] {
|
pub hkt Functor[Self<T>] {
|
||||||
fn <U> map(f: fn &T -> U) -> Self<U> // &self implied
|
fn <U> map(f: fn (t: &T) -> U) -> Self<U> // &self implied
|
||||||
}
|
}
|
||||||
|
|
||||||
pub hkt Applicative[Self<T>] : Functor[Self<T>] {
|
pub hkt Applicative[Self<T>] : Functor[Self<T>] {
|
||||||
|
@ -30,13 +30,6 @@ pub int MutRefClosure(P : Tuple = ())<D = Any> -> T : ConsClosure(P)<D> -> T {
|
|||||||
mut ref fn call(...p: P) -> T
|
mut ref fn call(...p: P) -> T
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Type is `mut fn (P)<D> -> T`
|
|
||||||
*/
|
|
||||||
pub int MutClosure(P : Tuple = ())<D = Any> -> T : MutRefClosure(P)<D> -> T {
|
|
||||||
mut fn call(...p: P) -> T
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type is `ref fn (P)<D> -> T`
|
* Type is `ref fn (P)<D> -> T`
|
||||||
*/
|
*/
|
||||||
@ -44,10 +37,17 @@ pub int ReadRefClosure(P : Tuple = ())<D = Any> -> T : MutRefClosure(P)<D> -> T
|
|||||||
ref fn call(...p: P) -> T
|
ref fn call(...p: P) -> T
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type is `mut fn (P)<D> -> T`
|
||||||
|
*/
|
||||||
|
pub int MutClosure(P : Tuple = ())<D = Any> -> T : ConsClosure(P)<D> -> T {
|
||||||
|
mut fn call(...p: P) -> T
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type is `fn (P)<D> -> T`
|
* Type is `fn (P)<D> -> T`
|
||||||
*/
|
*/
|
||||||
pub int ReadClosure(P : Tuple = ())<D = Any> -> T : ReadRefClosure(P)<D> -> T {
|
pub int ReadClosure(P : Tuple = ())<D = Any> -> T : MutClosure(P)<D> -> T {
|
||||||
fn call(...p: P) -> T
|
fn call(...p: P) -> T
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user