mirror of
https://github.com/iritmaximus/haskell.git
synced 2026-10-12 19:13:39 +03:00
ex11. sumRights done with challenge
This commit is contained in:
+1
-1
@@ -240,7 +240,7 @@ a +|+ b = [head a, head b]
|
||||
-- sumRights [Left "bad!", Left "missing"] ==> 0
|
||||
|
||||
sumRights :: [Either a Int] -> Int
|
||||
sumRights = todo
|
||||
sumRights = foldr (\a b -> fromRight 0 a + b) 0
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
-- Ex 12: recall the binary function composition operation
|
||||
|
||||
Reference in New Issue
Block a user