mirror of
https://github.com/iritmaximus/haskell.git
synced 2026-10-12 19:13:39 +03:00
ex10. operator done
This commit is contained in:
@@ -218,6 +218,11 @@ allCombinations xs = merge (map (`allCombinationsWithStr` xs) xs) []
|
|||||||
-- [1,2,3] +|+ [4,5,6] ==> [1,4]
|
-- [1,2,3] +|+ [4,5,6] ==> [1,4]
|
||||||
-- [] +|+ [True] ==> [True]
|
-- [] +|+ [True] ==> [True]
|
||||||
-- [] +|+ [] ==> []
|
-- [] +|+ [] ==> []
|
||||||
|
(+|+) :: [a] -> [a] -> [a]
|
||||||
|
[] +|+ [] = []
|
||||||
|
a +|+ [] = [head a]
|
||||||
|
[] +|+ b = [head b]
|
||||||
|
a +|+ b = [head a, head b]
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user