4 ms·
If you need something predictable, you'll usually use a vector in Haskell. Nothing obligates you to use a list. I regard it as more of a pleasant surprise and
by coolsunglasses 10y ago
If you need something predictable, you'll usually use a vector in Haskell. Nothing obligates you to use a list.
I regard it as more of a pleasant surprise and something that surprises/confuses people when they benchmark `String` (which is `[Char]` under the hood) against `Text` (which is an `Array` under the hood: http://hackage.haskell.org/package/text-1.2.2.1/docs/src/Data-Text-Internal.html#Text http://hackage.haskell.org/package/text-1.2.2.1/docs/src/Dat... )
I've had `String` come out faster than `Text` in benchmarks plenty of times, including for a colleague when we were writing up this post https://lorepub.com/post/2016-12-17-Haskell-Pitfalls https://lorepub.com/post/2016-12-17-Haskell-Pitfalls
What I'm not going to do is perform free labor for a man with a bad attitude who is 100x wealthier than I am. I'm not saying you should design a performance oriented language around short-cut fusion, but the "cost" of using Haskell is generally not what people think it is.
The span of applicability for Haskell, IME, ranges from Java/Golang to Ruby. It's no replacement for C++, but it does come close in some applications that aren't hard/soft real-time.