diff --git a/sketching/april_2025/hkt.dm b/sketching/april_2025/hkt.dm index c4d2e20..d8e3c0b 100644 --- a/sketching/april_2025/hkt.dm +++ b/sketching/april_2025/hkt.dm @@ -1,5 +1,5 @@ pub hkt Functor[Self] { - fn map(f: fn &T -> U) -> Self // &self implied + fn map(f: fn (t: &T) -> U) -> Self // &self implied } pub hkt Applicative[Self] : Functor[Self] { diff --git a/sketching/april_2025/template.dm b/sketching/april_2025/template.dm index a2470b9..af8408c 100644 --- a/sketching/april_2025/template.dm +++ b/sketching/april_2025/template.dm @@ -30,13 +30,6 @@ pub int MutRefClosure(P : Tuple = ()) -> T : ConsClosure(P) -> T { mut ref fn call(...p: P) -> T } -/** - * Type is `mut fn (P) -> T` - */ -pub int MutClosure(P : Tuple = ()) -> T : MutRefClosure(P) -> T { - mut fn call(...p: P) -> T -} - /** * Type is `ref fn (P) -> T` */ @@ -44,10 +37,17 @@ pub int ReadRefClosure(P : Tuple = ()) -> T : MutRefClosure(P) -> T ref fn call(...p: P) -> T } +/** + * Type is `mut fn (P) -> T` + */ +pub int MutClosure(P : Tuple = ()) -> T : ConsClosure(P) -> T { + mut fn call(...p: P) -> T +} + /** * Type is `fn (P) -> T` */ -pub int ReadClosure(P : Tuple = ()) -> T : ReadRefClosure(P) -> T { +pub int ReadClosure(P : Tuple = ()) -> T : MutClosure(P) -> T { fn call(...p: P) -> T }