deft/journal/2020-12-23--16-50-17Z--effects_system_in_clojure.org
2020-12-23 16:56:47 +01:00

907 B

Effects system in Clojure

tags :: clojure source ::

Warning foreword. The Effect system (see type à la carte) from the Freer Monad article takes in root in a precise definition. Here the notion of Effect system will probably feel totally skewed from the perspective of this article. But I will talk about how to use the same ideas in a dynamicly typed programming language. And in particular Clojure.

On a high level perspective the end goal of an Effect system is to be able to write program such that the semantic of the program will depend on the context the program is executed in.

So for example, let's say you write a program like this:

(let [x (first-action)
      y (second-action)
      z (third-action x y)]
  (if z
    (fourth-action x)
    (fifth-action y)))