ex10. operator done

This commit is contained in:
Aaro Koivukangas
2024-01-16 20:13:17 +02:00
parent cdb38e1c72
commit dd3918b3ba
+5
View File
@@ -218,6 +218,11 @@ allCombinations xs = merge (map (`allCombinationsWithStr` xs) xs) []
-- [1,2,3] +|+ [4,5,6] ==> [1,4]
-- [] +|+ [True] ==> [True]
-- [] +|+ [] ==> []
(+|+) :: [a] -> [a] -> [a]
[] +|+ [] = []
a +|+ [] = [head a]
[] +|+ b = [head b]
a +|+ b = [head a, head b]
------------------------------------------------------------------------------