Haskell — Definition of higher-order functions (1)

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

1.  myFoldl :: (a -> b -> a) -> a -> [b] -> a

2.  myFoldr :: (a -> b -> b) -> b -> [a] -> b

3.  myIterate :: (a -> a) -> a -> [a]

4.  myUntil :: (a -> Bool) -> (a -> a) -> a -> a

5.  myMap :: (a -> b) -> [a] -> [b]

6.  myFilter :: (a -> Bool) -> [a] -> [a]

7.  myAll :: (a -> Bool) -> [a] -> Bool

8.  myAny :: (a -> Bool) -> [a] -> Bool

9.  myZip :: [a] -> [b] -> [(a, b)]

10. myZipWith :: (a -> b -> c) -> [a] -> [b] -> [c]

Scoring

Each function scores 10 points.

Problem information

Author: Unknown
Translator: Jordi Petit

Generation: 2026-02-03T17:01:13.902Z

© Jutge.org, 2006–2026.
https://jutge.org
