3 ms·
Sometimes you really need to drop into mutation of state in perf critical paths
by tlarkworthy 10y ago
Sometimes you really need to drop into mutation of state in perf critical paths
- roberthensing 10y agoThere are great tools for that in both Scala and Haskell. In Scala you can use var, which is easy. In Haskell you can write your algorithm using ST and then use it as a pure function by means of runST. The type system guarantees that all such state is local to the invocation.