Skip to content
0:00 / 0:00

#clojure#specter#functionalprogramming

Understanding Specter: Clojure's missing piece

Misophistful

1.6K subscribers • 8 videos on Hallway

YouTube
  • Recommended by 4 people: 1 on Hacker News, 1 on Lobsters and 2 in engineering communities.
  • Linked in the descriptionnathanmarz/specter

Intermediate. Assumes working knowledge.

11K views9 years ago4 recommendations

Programming languagesSoftware designLisp and ClojureFunctional programmingData structures

This tutorial demonstrates how to use the Specter library in Clojure to query and transform deeply nested data structures declaratively.

Learn how to elegantly manipulate nested data structures with Specter. Specter: github.com/nathanmarz/specter Language: clojure.org Editor: atom.io/ proto-repl: atom.io/packages/proto-repl proto-repl setup guide: gist.github.com/jasongilman/d... Atom syntax theme: atom.io/themes/borealis-syntax

Why it's here

4 people recommend this

What people say. Recommended as a great introduction to using Specter for elegant data structure manipulation in Clojure.

u/MM-7757in r/Clojure • Recommends

"Understanding Specter: Clojure's missing piece" by Misophistful (updated link)

u/aarkerioin r/Clojure • Recommends

Understanding Specter: Clojure's missing piece

yogthoson Hacker News • Recommends

On “Why I'm Productive in Clojure (2013)”

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 link to this video short video to see how it works.

Yogthoson Lobsters • Recommends

Manipulating complex data structures using Specter

u/Collaborologistin r/Clojure • Mentions

Just came across specter... mind blown! Mind blown... Check these if you haven't already: - Understanding Specter: Clojure's missing piece - Specter Powerful and Simple Data Structure Manipulation - Nathan Marz I kinda do and wanna "get it"... Now gotta go rewrite some code... (Thanks, Nathan!)

u/yogthosin r/Clojure • Mentions

On “Vanilla Clojure VS "that missing piece"”

My team started using specter and we find it provides a number of advantages that make it worth learning. The main feature is that it allows efficiently transforming complex data structures in a declarative manner. It's also handy that specter preserves original types for collections after transformations. This video is an excellent intro in my opinion.

u/yogthosin r/Clojure • Mentions

On “New Clojurians: Ask Anything”

Clojure offers a few things over Ruby or Js. First, I think the tooling and packaging situation is much better. With Clojure, I can use Leiningen or Boot for every aspect of the project lifecycle. They manage dependencies, run tests, package the app, and so on. The way libraries are managed is a lot saner in my opinion. Maven repos are immutable, and libraries are pulled in by explicit versions. This makes it much easier to do repeatable builds. Packaging situation is much better as well. A Clojure app is just a jar that contains everything the app needs to run. You can put that jar anywhere with a JVM runtime, and you're good to go. I think Clojure provides a superior workflow with the R…

u/yogthosin r/Clojure • Mentions

On “What for you "sells" Clojure?”

I think you have to contextualize the pitch in terms of problems that Clojure solves. I haven't found listing off features to be an effective way to pitch the language, because that doesn't resonate with people who aren't already familiar with these features. For example, you could talk about the difficulty of maintaining large projects written in imperative/OO style. If you come back to a project a few months later and make a change, it's hard to guarantee you didn't accidentally affect another part of the project that references the data you changed. This provides the context for introducing immutability, and how it addresses the problem. Another example would be the workflow. A common u…

u/yogthosin r/Clojure • Mentions

On “New Clojurians: Ask Anything”

I highly recommend taking a look at Spectre for complex data transformations. It provides a declarative way to specify the changes you wish to apply to the data and executes them. The library has been optimized so that you can expect good performance out of the box in majority of cases. This video is a good intro to it.

u/stefan_kurcubicin r/Clojure • Mentions

On “"Understanding Specter: clojure's missing piece" by Misophistful”

reuploded 10min ago link to this video

u/yogthosin r/haskell • Mentions

On “Clojure vs. The Static Typing World (haskell in particular)”

Now compare to how you do this Clojure.

u/yogthosin r/Clojure • Mentions

On “Does Clojure have a "killer app"?”

I really think Specter could be a killer app for Clojure. Most domains involve querying and transforming complex data structures. I haven't seen anything comparable to this in any other language I've used.

Scarbutton Hacker News • Mentions

On “Why GitHub used Haskell for Semantic”

(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 link to this video

kgwxdon Hacker News • Mentions

On “Clojure from a Schemer's Perspective”

> 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/Clojure1 mentioned Specter2 with a link to this video3. One of the first things the video covers is how the library deals with this concern. 1 link 2 link 3 link to this video

u/_youtubot_in r/Clojure • Mentions

On “New Clojurians: Ask Anything”

Video linked by /u/yogthos: Title|Channel|Published|Duration|Likes|Total Views :----------:|:----------:|:----------:|:----------:|:----------:|:----------: Understanding Specter: Clojure's missing piece|Misophistful|2017-10-06|0:40:31|37+ (100%)|911 > Learn how to elegantly manipulate nested data structures... --- ^Info ^| ^/u/yogthos ^can ^delete ^| ^v2.0.0

u/yogthosin r/Clojure • Mentions

On “Functional Works - Functional Programming Report 2017”

I think Reagent/re-frame with figwheel is a killer tool for front-end. Nothing compares to that workflow in vanilla Js. Specter is another general purpose killer tool in my opinion. Pretty much all applications boil down to transforming data, and I haven't seen anything in other languages that can hold a candle to this.