jlongster / transducers.js

A small library for generalized transformation of data (inspired by Clojure's transducers)
BSD 2-Clause "Simplified" License
1.72k stars 54 forks source link

Why the dependency on Immutable? #34

Closed nmn closed 9 years ago

nmn commented 9 years ago

Does Immutable support mean, requiring Immutable with Transducers? Or does Transducers actually use Immutable behind the scenes?

jlongster commented 9 years ago

Ack, good call, it's supposed to be in devDependencies. We use it in some tests. I'll fix, thanks!

nmn commented 9 years ago

Since I have you here. Can you also clarify between the collection first vs collection last syntax? Thanks.

jlongster commented 9 years ago

What do you mean? To keep in line with most JS function styles, you can pass the collection first: map([1, 2, 3], x => x + 1). And all of the seq functions take a collection first.

nmn commented 9 years ago

So can we no longer pass collection last? for the transducer function for example? Does the collection have to be first in all cases? (if passing a collection at all.)

Just confirming as this was not the case in your Blog post, but things seem to have changed since.

jlongster commented 9 years ago

Ah, yeah the order was switched a while back. I suppose I should either update the blog post or make a note about that. I prefer collection last but I didn't know if we could oppose the current JS style. Maybe we can, but for now collection is passed first.

jlongster commented 9 years ago

Fixed in 7615a460d52e34ba73a61647bf69887a07a00fa3

nmn commented 9 years ago

I prefer collection last as well.

nmn commented 9 years ago

Thanks