Abstract

The aim of this note is to present an alternative definition of the<br />zipWith 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.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.