Understanding Specter: Clojure's missing piece
Misophistful1 HN recommenders · 2017–2021
12K views · tutorial · dated · Uploaded 2017-10-06
A screencast tutorial on Specter, a Clojure library for navigating and transforming nested data structures declaratively, demonstrated in a REPL.
Pointed to as a short, clear demonstration of how Specter simplifies manipulating complex nested data.
53:22Ruby Conf 12 - Y Not- Adventures in Functional Programming by Jim Weirich
Confreaks
42:03The Soul of Erlang and Elixir • Sasa Juric • GOTO 2019
GOTO Conferences
1:01:39"Simple Made Easy" - Rich Hickey (2011)
Strange Loop Conference
25:06"Making Impossible States Impossible" by Richard Feldman
elm-conf
1:31:06William Byrd on "The Most Beautiful Program Ever Written" [PWL NYC]
PapersWeLove
31:44The Value of Values with Rich Hickey
InfoQ
46:09Why Isn't Functional Programming the Norm? – Richard Feldman
Metosin
1:03:29Maybe Not - Rich Hickey
ClojureTV
3 comments from Hacker News
Explicit recursion is rarely used in FP, and it's often a code smell. It's almost always better to use higher order functions instead. The advantage is that you can implement a particular transformation once, check for edge cases, and reuse it from there on. You also end up with declarative code that talks about what it's doing without distracting your with implementation details. Clojure has a rich set of functions for manipulating data such as map, filter, reduce, and so on. There are also libraries such as Specter [LINK] that allow you to declaratively transform complex data. I highly recommend watching this [VIDEO] short video to see how it works.
(assoc-in foo ["bar" "alice" "bob"] 12) Of course, in clojure you mostly use :keywords instead "strings" as keys which has a ton of benefits. There's also specter if want something more powerful at the cost of an additional lib. [LINK] [VIDEO]
> You might just be using a completely different underlying data structure than expected, depending on which operations you've performed. I haven't had the pleasure of using Clojure in production, but I'm somewhat obsessed with the language and follow it fairly closely. Someone on r/Clojure[1] mentioned Specter[2] with a link to this video[3]. One of the first things the video covers is how the library deals with this concern. [1] [LINK] [2] [LINK] [3] [VIDEO]