import Control.Monad
import Control.Monad.State
import Control.Monad.List
sumUp :: [Int] -> State Int [()]
sumUp = sequence . map (modify . (+))
type StateWithList = ListT (State Int)
sumUp' xs = do x <- xs
lift (modify (+x))
return (lift get)
sumThreeLists :: [Int] -> [Int] -> [Int] -> Int
sumThreeLists xs ys zs = execState (sumUp xs >> sumUp ys >> sumUp zs) 0
main = do print $ execState (sumUp [1,2,3]) 0
print $ sumThreeLists [1..10] [1..10] [1..10]