Daniel Amber demonstrates how to build a lookup map in Clojure using reduce, group-by, and juxt.
Sometimes you might need to access records often and quickly. Clojure provides really cool options to get data structured in really nice ways to do that. In this video, I cover 3 of them!
Clojure is awesome, I think where it gets tricky is when you come across functions that aren't common in other languages so when you're starting out using it, they arent the first ones that come to mind (such as juxt and group-by). By running through examples like this I hope to show the utility of those functions in a practical way.
Gist: gist.github.com/danownsthisspace/4c231fd58f2d191dfc7732095cb…
intro
The problem
Using filter
Why use a lookup map
Create lookup map using reduce
Looking at the into function
Solution using group-by solution
Solution using juxt
Plead for subs
Why it's here
1 person recommends this
What people say. Recommended as a helpful tutorial for learning idiomatic Clojure patterns.
Moments people linked to
S
u/Silent_Plastic_1748in r/Clojure • Recommends
New favorite youtuber found.
Hey I just wanted to share with you my new favorite youtuber on Clojure issues. I think his content is really valuable for everyone who doesnt know the patterns yet of how to write idiomatic Clojure: [video