The answer is not obvious to me, so I resorted to brute-force. The generation of all combinations is the most interesting part, especially the
contrast between list comprehension and list monad.
all_combination' :: [Int] -> [Int] all_combination' list = do i <- [1..3] loop i 0 where loop 0 acc = return acc loop n acc = do x <- list loop (n-1) $ x+acc