Haskell foldr1 lambda function which adds tuple values
I have been scratching my head trying to figure this out. How do I use foldr1 (or any other fold for that matter) in order to get the sum of tuples in a list. Example: list = [(1,2), (3,4)] sum = 10 I’ve tried foldr1 (\x y -> fst(x) + snd(x) + y) [(1,2),(3,4)] but… Read More Haskell foldr1 lambda function which adds tuple values