[Haskell-cafe] Being impure within a 'pure' function
Max Rabkin
max.rabkin at gmail.com
Thu Apr 23 08:15:16 EDT 2009
On Wed, Apr 22, 2009 at 10:38 AM, Daniel K. <anmeldemails at gmail.com> wrote:
> Dijkstra's algorithm ... relies heavily on mutating arrays
Well, the imperative implementation does.
> Not mutating the underlying arrays would probably result in poor
> performance.
Indeed. Non-mutable arrays are not very performant for mutations.
Tree-like data structures Are Your Friend.
I've never compared the performance of an ST-based implementation with
a set/map based algorithm, but I've often found the latter usably
performant.
--Max
More information about the Haskell-Cafe
mailing list