Why use an effect system?

A function without any effect is called total and corresponds to mathematically total functions – a good place to be. Then we have effects for partial functions that can raise exceptions (exn), and potentially non-terminating functions as div (divergent). The combination of exn and div is called pure as that corresponds to Haskell’s notion of purity. On top of that we find mutability (as st) up to full non-deterministic side effects in io.

The Koka Programming Language

1 Like