>>> foldr1 (+) [1..4] 10
>>> foldr1 (+) [] Exception: Prelude.foldr1: empty list
>>> foldr1 (+) Nothing *** Exception: foldr1: empty structure
>>> foldr1 (-) [1..4] -2
>>> foldr1 (&&) [True, False, True, True] False
>>> foldr1 (||) [False, False, True, True] True
>>> foldr1 (+) [1..] * Hangs forever *
>>> foldr1 (+) [1..4] 10 >>> foldr1 (+) [] *** Exception: Prelude.foldr1: empty list >>> foldr1 (-) [1..4] -2 >>> foldr1 (&&) [True, False, True, True] False >>> foldr1 (||) [False, False, True, True] True >>> force $ foldr1 (+) [1..] *** Exception: stack overflow
>>> bifoldr1 (+) (5, 7) 12
>>> bifoldr1 (+) (Right 7) 7
>>> bifoldr1 (+) (Left 5) 5
> bifoldr1 (+) (BiList [1, 2] [3, 4]) 10 -- 1 + (2 + (3 + 4))
>>> bifoldr1 (+) (BiList [1, 2] []) 3On empty structures, this function throws an exception:
>>> bifoldr1 (+) (BiList [] []) *** Exception: bifoldr1: empty structure ...