IMO, Koka (or something similar) has more potential to become a mainstream language than "traditional" FP languages (Haskell, OCaml, Idris, etc.).
Effects seem to be easier to understand than monads (at least on a superficial level) and more modular (I don't have a lot of experience with Haskell, so take that with a grain of salt).
Its syntax is also very close to C-like languages.
Taken from the Koka book[2]:
fun square1(x : int) : total int {
return x*x
}
fun square2(x : int) : io int {
println( "a not so secret side-effect" )
return x*x
}
`square1` is a pure mathematical function, so its effect is `total`. `square2` has a side-effect because of `println`, so its effect is `io`. This means that `square2` can raise exceptions, not terminate, be non-deterministic, read and write to the heap, and do any input/output operations.Note that Koka can infer effects, so these annotations are optional.
[1]: https://www.microsoft.com/en-us/research/project/koka/?from=...
[2]: https://koka-lang.github.io/koka/doc/kokaspec.html#sec-effec...