0

After watching Rich Hickey's talk on transducers, my understanding is that they can

  1. greatly optimize performance of compositions of reducers (by removing the need for intermediate sequence representations)
  2. assist a language/API designer in getting reducers 'for free' over all of their sequences/iterables/streams/etc as long as they are implemented once as a transducer.

Beyond these advantages (which may not be relevant for many) are there any other benefits to coding with transducers?

4

1 回答 1

0

转换器允许您编写转换函数而无需关心数据结构。所以同样的地图、过滤器,无论是列表、序列、通道、平行。

参见例如https://github.com/matthiasn/talk-transcripts/blob/master/Hickey_Rich/Transducers/00.43.52.jpg

于 2015-02-27T15:58:24.563 回答