Изменения

Перейти к: навигация, поиск

Функциональное программирование

121 байт убрано, 14:14, 27 апреля 2015
subsequences
subsequences :: List a -> List (List a)
subsequences Nil = Cons Nil Nil
subsequences xs = (subseqtoend xs) ++ (subseqtoend (init xs)) where subseqtoend :: List a -> List (List a) subseqtoend Nil = Nil subseqtoend (Cons x xs) = subsequences xs ++ (Cons map (Cons x xs) (subseqtoend($ subsequences xs)))
==permutations==
120
правок

Навигация