3 ms·
I don't get this, what is hackish or immoral about this: http://hackage.haskell.org/packages/archive/bytestring/0.9.0.4/doc/html/src/Data-ByteString-Internal.h
by applicative 16y ago
I don't get this, what is hackish or immoral about this:
http://hackage.haskell.org/packages/archive/bytestring/0.9.0.4/doc/html/src/Data-ByteString-Internal.html http://hackage.haskell.org/packages/archive/bytestring/0.9.0...
which makes as many uses of unsafePerformIO as it exports functions, and the beautiful pure interface that is thereby created:
http://hackage.haskell.org/packages/archive/bytestring/0.9.0.4/doc/html/Data-ByteString.html http://hackage.haskell.org/packages/archive/bytestring/0.9.0...
It seems to me that there is an element of hypocrisy in some of the complaints above; it is as if they were saying:
> In Haskell, it's a nightmare to define a pure function with IO. You have to use that dreadful hack `unsafePerformIO`! In practical languages, by contrast, we are spared this boilerplate, since basically every line is already unsafePerformIO.
- masklinn 16y ago> It seems to me that there is an element of hypocrisy in some of the complaints above; it is as if they were saying Apart from the "nightmare" part, this statement you made up happens to be factually true. What is your issue with it? It's exactly what happens: in most other langages, every line is indeed unsafePerformIO. Isn't that fact one of the reasons Haskellers give for using haskell in the first place?
- jrockway 16y agoWe use Haskell so that 99% of the time, the compiler can prove our program safe. Then, the other 1% of the time, we use our human intuition to decide to "gamble" and disagree with the compiler. In most languages, 100% of your code is that same gamble.