Re: transducers

"Gabriel Scherer [email protected] [ocaml_beginners]" <[email protected]>
Newsgroups gmane.comp.lang.ocaml.beginners
Message-ID <CAPFanBHzpYn1UENvG3bQqp5eriZaShD6wEyV=6iEdWWft1yF3g@mail.gmail.com>
It's hard to read through the propaganda to see what exactly the interface
is, or what is novel (we've had lazy sequence datatypes in functional
languages for ages, and we've been reifing operation to optimize them on
the fly for ages as well, which transducer.js doesn't attempt). There are
many implementation of lazy sequences in OCaml that allow you to combine
intermediate transformations without rebuilding the whole data-structure,
see for example:
  - batteries Enum module (a bit too featureful for its own good)
https://ocaml-batteries-team.github.io/batteries-included/hdoc2/BatEnum.html
  - batteries Seq module
https://ocaml-batteries-team.github.io/batteries-included/hdoc2/BatSeq.html
  - Simon Cruanes' iterators/generators:
http://cedeela.fr/~simon/software/gen/Gen.S.html


If you have specific needs (for example you want to exactly mirror
transducerjs' interface), you may want to implement something on your own.
You can do something reasonable in one afternoon's of work.

On Fri, Sep 19, 2014 at 1:43 AM, [email protected] [ocaml_beginners] <
[email protected]> wrote:

>
>
> What's the Ocaml equivalent of transducers, as found in the library
> transducers.js*?
>
> Or was Ocaml just exceeded by JavaScript :P
>
>
> * Transducers.js: A JavaScript Library for Transformation of Data
> <http://jlongster.com/Transducers.js--A-JavaScript-Library-for-Transformation-of-Data>
>
>
>        [image: image]
> <http://jlongster.com/Transducers.js--A-JavaScript-Library-for-Transformation-of-Data>
>      Transducers.js: A JavaScript Library for Transformation ...
> <http://jlongster.com/Transducers.js--A-JavaScript-Library-for-Transformation-of-Data>
> Transducers.js: A JavaScript Library for Transformation of Data September
> 18 2014 If you didn't grab a few cups of coffee for my last post, you're
> going to ...
>       View on jlongster.com
> <http://jlongster.com/Transducers.js--A-JavaScript-Library-for-Transformation-of-Data>
>   Preview by Yahoo
>
>
>
>
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.