Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cuttingSum :: Num a => [a] -> [a]
- cuttingSum l =
- let
- cuttingSum_iter [] res = reverse (res)
- cuttingSum_iter ll res =
- cuttingSum_iter (tail ll) ((foldl (+) 0 ll) :: res)
- in
- cuttingSum_iter l []
- main = do
- print $ cuttingSum [1,2,3]
- ERROR "task9-02-1.hs":5 - Inferred type is not general enough
- *** Expression : foldl (+) 0 ll
- *** Expected type : a
- *** Inferred type : _26
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement