koka-lang
2021-12-31 ยท 1 min read
Koka Book: https://koka-lang.github.io/koka/doc/book.html
- functions literally all the way down (mod some primitives)
- algebraic effects nicely integrated into the language at all levels
- first-class effect type, composes nicely, allows user-defined control flow, almost all control syntax (e.g. while, for, ..) is actually just functions
fun for ( start : int, end : int, action : (int) -> e ()) : e ()fun while( pred : () -> <div|e> bool, action : () -> <div|e> () ) : <div|e> ()- note:
<div|e>means polymorphic effecteunion effectdiv(divergent, possibly non-terminating)
- note:
- universal dot call syntax!
myint.double == double(myint) - effects effectively specify an "interface" of handlers, which can be overridden
- very curious how extensive non-linear control flow affects performance : )