Question: MUST BE WRITTEN IN ELM Write a function subsequences: List a -> List (List a) that computes all subsequences of a list. This function is
MUST BE WRITTEN IN ELM
Write a function subsequences: List a -> List (List a) that computes all subsequences of a list. This function is analogous to the powerset of a set. Your implementation may return subsequences in any order. For example, the following are two answers, among others, that are correct: > subsequences (List.range 1 3) [[, [1],12],[1,2],[3],[1,3], [2,3],[1,2,3]]: List (List Int) > subsequences (List.range 1 3) [[1,2,3],12,3],[1,31,[3],11,2],[2],[1], 011: List (List Int)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
