Skip to main content
added explanation
Source Link
Laikoni
  • 26.4k
  • 7
  • 54
  • 116

Haskell, 26 bytes

zipWith($)l l=id:reverse:l 

Try it online! Usage example: zipWith($)l ["abc","def","ghi"] yields ["abc","fed","ghi"].

Explanation:

l is an infinite list of functions alternating between the identity function and the reverse function.

The main function zips l and the input list with the function application $, that is for an input ["abc", "def", "ghi"] we get [id$"abc", reverse$"def", id$"ghi"].

Haskell, 26 bytes

zipWith($)l l=id:reverse:l 

Try it online!

Haskell, 26 bytes

zipWith($)l l=id:reverse:l 

Try it online! Usage example: zipWith($)l ["abc","def","ghi"] yields ["abc","fed","ghi"].

Explanation:

l is an infinite list of functions alternating between the identity function and the reverse function.

The main function zips l and the input list with the function application $, that is for an input ["abc", "def", "ghi"] we get [id$"abc", reverse$"def", id$"ghi"].

Source Link
Laikoni
  • 26.4k
  • 7
  • 54
  • 116

Haskell, 26 bytes

zipWith($)l l=id:reverse:l 

Try it online!