4 ms·
>That's functional programming for you. Uhm, what? No it's not. Haskell has stream fusion, thereby generating assembler that looks a lot like the optimal impe
by coolsunglasses 13y ago
>That's functional programming for you.
Uhm, what? No it's not.
Haskell has stream fusion, thereby generating assembler that looks a lot like the optimal imperative version.
- rybosome 13y agoVery cool - I was not aware of this feature. Fwiw, I'm actually something of an FP zealot; I failed to make a stronger case in my comment because I'm tired of arguing, and I'm concerned that I'm being obnoxious.
- burntsushi 13y agoThis is kind of misleading. Stream fusion isn't baked into Haskell; you need to use a library. [1,2] [1] - https://ghc.haskell.org/trac/ghc/ticket/915 [2] - http://hackage.haskell.org/package/stream-fusion
- danieldk 13y agoBut, many of the commonly used libraries already use stream fusion, e.g. vector and text.
- coolsunglasses 13y agohttp://hackage.haskell.org/package/text-0.1/docs/Data-Text-Fusion.html http://hackage.haskell.org/package/text-0.1/docs/Data-Text-F... http://hackage.haskell.org/package/vector-0.9.1/docs/Data-Vector-Fusion-Stream.html http://hackage.haskell.org/package/vector-0.9.1/docs/Data-Ve... Except it's bloody everywhere in the libraries you use and you can design your own libraries around it. A language powerful enough that things like this can be done in libraries instead of in the compiler is a good thing.