I am new to Haskell and functionally programming, recently began to parse an article about https://eax.me/haskell-parallel/ about multithreading. So, it is not clear to me how the where works in this function from the article:
groupedPasswords :: Int -> Int -> CharList -> [[Password]] groupedPasswords totalLen prefLen charList = map (prependPrefix postfixes) prefixes where prefixes = replicateM prefLen charList postfixes = replicateM restLen charList restLen = totalLen - prefLen prependPrefix post prefix = map (prefix ++) post The fact is that here with the help of where the function prependPrefix is created with two arguments post and prefix, but in the expression map (prependPrefix postfixes) prefixes this function is passed one postfixes argument, and where is the second argument, where does it take it, where is the argument called prefix? I understand that there are two nested maps here and this is necessary for unpacking two nested lists and their concatenation and further packing into the list of lists, but again map is a function of two arguments. How can this be? The function works, but I do not understand. The end result and the meaning of the function need not be explained. Please tell knowledgeable people where I think wrong.