If you recall, I wrote some Ruby code to calculate combinations of values in lists . I needed to create a list of all combinations of values, where each combination had between 0 and N number of values, where N is equal to length of the source list. (I'm not sure I'm explaining that correctly, but refer to my previous post for examples). Here's my first shot at how to do this in erlang . It look longer to find math:pow and how to convert a float to an integer in erlang than to write the actual code. -module(s). -export([combos/1]). combos(L) -> combos(L, bit_masks(length(L))). combos(L, [BH|BT]) -> [mask_list(L, BH)|combos(L, BT)]; combos(_, []) -> []. mask_list([H|T], [BH|BT]) -> case (BH) of 1 -> [H|mask_list(T, BT)] ; 0 -> mask_list(T, BT) end; mask_list([], []) -> []. bit_masks(NumColumns) -> bit_masks(0, round(math:pow(2, NumColumns))-1, NumColumns). bit_masks(Max, Max, NumColumns) -> [padl(NumColumns, bl(Max))]; bit_ma...