module CurryLab where -- Meta comment: For each function that outputs multiple answers, the order of -- the answers does not matter, e.g., it is up to you which answer to output -- first. -- [2 marks] -- Integers from 0 to n-1. If n <= 0, there is no answer. below :: Int -> Int below = error "TODO" -- [4 marks] -- Sublists of xs. This means: -- If you pretend xs to be a [multi]set, then a sublist is like a subset, -- but furthermore, its elements follow the same order as in xs. -- -- Example: The sublists of [0,1,2] are: -- [], [0], [1], [2], [0,1], [0,2], [1,2], [1,2,3] sublist :: [a] -> [a] sublist = error "TODO" -- We are given a child->parent relation as a non-deterministic function from -- children to parents. E.g., George's parents are Elizabeth and Henry. parent :: String -> String parent "George" = "Elizabeth" ? "Henry" parent "Fiona" = "Elizabeth" ? "Henry" parent "Mary" = "Theresa" ? "Henry" parent "Frederick" = "Theresa" ? "Francis" -- [4 marks] -- Find the siblings of the input person. -- Definition: y is a sibling of x iff x/=y and someone is a parent of both. -- Duplicate answers are OK, e.g., sibling "George" gives "Fiona" twice because -- of Elizabeth and Henry. sibling :: String -> String sibling = error "TODO"