This problem explores the definition of high-order functions on lists.
Implement the followinf functions that work as the original Haskell
functions without using the original function eachself
(i.e., you cannot use *foldl* ti implement
*myFoldl* but you can use it to implement *myAll*).
Additionally. you can only use recursion to
implement *myFoldl, myFoldr, myIterate,
myUntil* and *myZip*.

*myFoldl :: (a -> b -> a) -> a -> [b] -> a**myFoldr :: (a -> b -> b) -> b -> [a] -> b**myIterate :: (a -> a) -> a -> [a]**myUntil :: (a -> Bool) -> (a -> a) -> a -> a**myMap :: (a -> b) -> [a] -> [b]**myFilter :: (a -> Bool) -> [a] -> [a]**myAll :: (a -> Bool) -> [a] -> Bool**myAny :: (a -> Bool) -> [a] -> Bool**myZip :: [a] -> [b] -> [(a, b)]**myZipWith :: (a -> b -> c) -> [a] -> [b] -> [c]*

Scoring

Each function scores 10 points.

Public test cases

**Input**

myFoldl (+) 1 [1..5] myFoldr (+) 1 [1..5] take 10 $ myIterate (*2) 1 myUntil (>100) (*2) 1 myMap ("la "++) ["joana", "mireia"] myFilter odd [1..10] myAll odd [1,3,5,3,1] myAny odd [2,4,6,8,10] myZip [1..4] [1..3] myZipWith (+) [1..4] [1..3]

**Output**

16 16 [1,2,4,8,16,32,64,128,256,512] 128 ["la joana","la mireia"] [1,3,5,7,9] True False [(1,1),(2,2),(3,3)] [2,4,6]

Information

- Author
- Albert Rubio / Jordi Petit
- Language
- English
- Translator
- Jordi Petit
- Original language
- Catalan
- Other languages
- Catalan
- Official solutions
- Haskell
- User solutions
- Haskell