An n-ary zipWith in Haskell

Daniel Fridlender
Mia Indrika

December 1998

Abstract:

The aim of this note is to present an alternative definition of the zipWith family in the Haskell Library Report. Because of the difficulties in defining a well-typed function with a variable number of arguments, the library presents a family of zipWith functions. It provides zip functions tex2html_wrap_inline32. For each n, tex2html_wrap_inline36 zips n lists with a n-ary function. Defining a single zipWith function with a variable number of arguments seems to require dependent types. We show, however, how to define such a function in Haskell by means of a binary operator for grouping its arguments. For comparison, we also give definitions of zipWith in languages with dependent types

Available as PostScript, PDF, DVI.

 

Last modified: 2003-06-08 by webmaster.