stream-fusion

What is fusion in Haskell?

会有一股神秘感。 提交于 2019-11-27 12:42:16
Every now and again I have been noticing the following in Haskell documentation: (for example in Data.Text ): Subject to fusion What is fusion and how do I use it? Alec In general, fusion refers to transformations whose purpose is to get rid of intermediate data structures. You fuse function calls that result in wasteful memory allocations into something more efficient. This is actually IMO one of the biggest applications of Haskell being pure. And you pretty much don't need to do anything to get it, it comes for free through the GHC compiler. Haskell is pure Because Haskell is pure, we get

What is fusion in Haskell?

早过忘川 提交于 2019-11-26 15:58:49
问题 Every now and again I have been noticing the following in Haskell documentation: (for example in Data.Text): Subject to fusion What is fusion and how do I use it? 回答1: In general, fusion refers to transformations whose purpose is to get rid of intermediate data structures. You fuse function calls that result in wasteful memory allocations into something more efficient. This is actually IMO one of the biggest applications of Haskell being pure. And you pretty much don't need to do anything to