Particularly for Erlang — 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…