|
|
|
|
|
by roberthensing
3582 days ago
|
|
There 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. |
|