News for hackers. Stuff that matters.
Re:Writing a JPEG Decoder in Rust – Part 2: Implementation I by steveklabnik on Friday August 19, 2016 @01:44PM (#12321862)

  > (except the obvious `:Vec<_>` type that is not required)
It is required, otherwise, `collect()` doesn't know what type of collection to collect into.

  > It may be possible to implement `.zipped` on tuples though.
This is impossible without varargs, no?
Re:Writing a JPEG Decoder in Rust – Part 2: Implementation I by pcwalton on Friday August 19, 2016 @01:50PM (#12321908)
> This is impossible without varargs, no?

Nah, you'd just implement it as an impl over and over on tuples of reasonable size (up to 16 or so).

It wouldn't be elegant, but it'd work in practice.

Re:Writing a JPEG Decoder in Rust – Part 2: Implementation I by cbreeden on Friday August 19, 2016 @08:04PM (#12324361)
Re:Writing a JPEG Decoder in Rust – Part 2: Implementation I by steveklabnik on Friday August 19, 2016 @01:52PM (#12321922)
Oh right, I see now.
Re:Writing a JPEG Decoder in Rust – Part 2: Implementation I by __s on Friday August 19, 2016 @08:41PM (#12324467)
Re:Writing a JPEG Decoder in Rust – Part 2: Implementation I by nercury on Friday August 19, 2016 @01:54PM (#12321943)
> `collect()` doesn't know what type of collection to collect into.

Yes, unless there is some other mention of Vec, i.e. it is returned from the function.

> This is impossible without varargs, no?

Varargs would definitely help, and would allow Rust to borrow more ideas without workarounds. But one can do it manually for each tuple variant.

Re:Writing a JPEG Decoder in Rust – Part 2: Implementation I by nimish on Friday August 19, 2016 @01:58PM (#12321971)
Haskell just brute force implements zipWith3, zipWith4 etc

Not elegant, but it works.

Re:Writing a JPEG Decoder in Rust – Part 2: Implementation I by tome on Friday August 19, 2016 @03:53PM (#12322981)
The un brute force way is to use the Applicative instance of ZipList.