How to Comprehend Comprehensions

2 · Brujo Benavides · Aug. 23, 2019, 2:07 p.m.
Summary
Particularly for ErlangGood Will Hunting (1997)So, I Gusti Ngurah Oka Prinarjaya was reading Joe’s Book and he found one of the most amazing examples of List Comprehensions I’ve ever seen…perms([]) -> [[]];perms(List) -> [ [H|T] || H <- List, T <- perms(List--[H]) ].Output:1> lib_misc:perms("123").["123","132","213","231","312","321"]And, of course… he couldn’t understand it. And, as a seasoned Erlang trainer, I got to tell you: He’s not alone… by any means. After a session of the BeamBA Meetup ...