TY - JOUR
AU - Daniel Fridlender
AU - Mia Indrika
PY - 1998/06/08
Y2 - 2019/12/16
TI - An n-ary zipWith in Haskell
JF - BRICS Report Series
JA - BRICS
VL - 5
IS - 38
SE - Articles
DO - 10.7146/brics.v5i38.19483
UR - https://tidsskrift.dk/brics/article/view/19483
AB - The aim of this note is to present an alternative definition of thezipWith family in the Haskell Library Report [5]. Because of the difficulties in defining a well-typed function with a variable number of arguments, [5] presents a family of zipWith functions. It provides zip functions zipWith2, zipWith3, . . . , zipWith7. For each n, zipWithn zips n lists with a n-ary function. Defining a single zipWith function with a variable number of arguments seems to require dependent types. Inspired by [3], 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.
ER -