pel_daniel

pel_daniel

Hi! I created some animations to explain what happens internally with map & reduce functions.
The code is open source. Any feedback is welcome !
https://lambdabricks.github.io/animating-hofs/

Showing Posts 1 to 10

OvermindDL1

OvermindDL1

Heh, that’s cool looking.

pel_daniel

pel_daniel OP

Thanks @OvermindDL1!

grych

grych

Creator of Drab

Nice, I finally understood reduce!

pel_daniel

pel_daniel OP

Great to hear it @grych !

grych

grych

Creator of Drab

It was a joke. Bad one, sorry!

Anyway, I like your animation and I am sure it is going to help to understand the functional approach. You might try to add more examples on reduce, like traversing the list of strings with counting the overall number of characters (to show that the reduced value doesn’t have to be the same type as an enumerable member), etc.

Great job!

AstonJ

AstonJ

Love it Daniel :023:

It reminds me of this screencast by Joe Armstrong:

:003: :lol:

OvermindDL1

OvermindDL1

I’d definitely say add Enum.flat_map if you are wanting to show the basics, it is one of the basic monad operators. :slight_smile:

AstonJ

AstonJ

Also just a quick thought - could you make it so that it takes a copy and works on (or makes obvious it’s) the copy? At the moment anyone new might thing it is altering the starting data, rather than returning a copy :slight_smile:

pel_daniel

pel_daniel OP

Thanks for the comments !

I’ve been thinking about how to make the list in the animation appear immutable but I don’t have a solution for it yet. Do you have any suggestions on how to do it Aston ?

pel_daniel

pel_daniel OP

At the beginning I was thinking of doing: map, reduce & filter because are the most common HOF.
Filter is a bit more difficult to represent visually because it uses an if statement.

flat_map would be also cool with examples from different Monads.

Where Next? Top

Trending in Guides/Tuts Top

krasenyp
You probably already know that <span>{nil}</span> in a HEEX template produces <span> </span> when rendered. I fin...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews