I am trying to write a Haskell function that takes two unary functions (f and g) and a list of numbers (ns) and alternatively applies those input functions f and g to the elements of the inputted list.
For example:
func double square [2, 3, 4, 5, 6]
would return
[4, 9, 8, 25, 12]
I am using WinGHCi for my compiler. Any help on writing this function would be appreciated, thanks.
zipWith
andcycle
. – luqui