This commit is contained in:
SuperCraftAlex
2024-03-09 18:34:25 +01:00
parent a2f89fc962
commit 6f80ab30a3
31 changed files with 860 additions and 890 deletions

View File

@@ -0,0 +1,14 @@
package blitz.func
class Monad<O> internal constructor(
val impure: () -> O
)
fun <O> unit(v: O): Monad<O> =
Monad { v }
fun unit(): Monad<Unit> =
Monad { }
fun <I, O> Monad<I>.bind(op: (I) -> O): Monad<O> =
Monad { op(this@bind.impure()) }