|
|
|
|
|
by CyberDildonics
1011 days ago
|
|
In Haskell you can provide your own prelude, which uses unsafe functions without bounds checks by default. So your solution is to rewrite the haskell standard library yourself? With CPP or cabal tricks I don't know what cabal tricks is supposed to mean here. |
|
> So your solution is to rewrite the haskell standard library yourself?
No need--the simplest solution is to pass flags correctly to the dependent library (set all flags BoundsChecks, UnsafeChecks, and InternalChecks to false for the vector package) for release builds.
Explanation after the one-line rebuttal:
This exactly matches the C++ behavior: no bound checks for release builds, but with bounds checks for debug builds. This shows that Haskell can do what C++ can do, very easily, just by passing compiler/cabal/stack flags correctly.
With this rebuttal, I think the issue is completely settled, at least for reasonable readers.