Skip to content

Latest commit

 

History

History
10 lines (10 loc) · 271 Bytes

permutationsWithRepetition.md

File metadata and controls

10 lines (10 loc) · 271 Bytes
-- permutationsWithRepetition :: Int -> [a] -> [[a]]
on permutationsWithRepetition(n, xs)
    if 0 < length of xs then
        foldl1(curry(my cartesianProduct)'s |λ|(xs), replicate(n, xs))
    else
        {}
    end if
end permutationsWithRepetition