From: piggybox Date: 2006-11-27T18:50:06+09:00 Subject: Re: ruby and list comprehension I've always thought list comprehension is just a bunch of map/filter/... transformation until I saw the following version of permutation: in Haskell: permutation [] = [[]] permutation xs = [x:ys | x <- xs, ys <- permutation (delete x xs)] in Erlang: permutation([]) -> [[]]; permutation(L) -> [[H|T] || H <- L, T <- permutation(L--[H])]. really neat, isn't it?