Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> But UIs are not pure functions, they have a deeply effectful nature, and being reactive all those effects are highly “situated” if you will (to use Rich Hickey’s word).

Oh, but we do this in ClojureScript the whole time.

You can express events and actions in pure functions as data and then take care of the effects outside of the core of your application.

A great example of how to do this is the "re-frame" framework [1] [2]. The documentation is also a joy to read.

> An example of this impedance surfacing in backend programming is a nontrivial map/reduce pipeline. What is the shape of the document at stage six?

There's many ways to find that out in Clojure/Script. There's the built-in `tap>` function [3] which can be used for debugging. You can use that to visualize complex data with Portal. [4]

    (defn inspect
      [coll]
      (doto coll tap>))
    
    (->> coll
         (map this)
         (inspect)
         (filter that))

[1] The framework: https://github.com/day8/re-frame

[2] A library with HTTP-Effects for your re-frame applications: https://github.com/Day8/re-frame-http-fx

[3] https://clojuredocs.org/clojure.core/tap%3E

[4] https://github.com/djblue/portal



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: