Change Closure hierarchy.

This commit is contained in:
Jesse Brault 2025-05-07 11:46:40 -05:00
parent 9cec999cb9
commit 68de104595
2 changed files with 9 additions and 9 deletions

View File

@ -1,5 +1,5 @@
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>] {

View File

@ -30,13 +30,6 @@ pub int MutRefClosure(P : Tuple = ())<D = Any> -> T : ConsClosure(P)<D> -> 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`
*/
@ -44,10 +37,17 @@ pub int ReadRefClosure(P : Tuple = ())<D = Any> -> T : MutRefClosure(P)<D> -> 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`
*/
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
}