Bjarke Dahl asked:

 | Has anyone made a generalization of accumArray, which
 | allows users to implement a pure function using
 | imperative features?

Take a look at the ST monad, implemented in most
(all?) Haskell compilers.

Relevant papers are:

  "Lazy Functional State Threads"
  John Launchbury & Simon Peyton Jones

  "Structuring Depth First Search Algorithms in Haskell"
  David King & John Launchbury

The last paper is one of the nicest papers I have ever read,
it describes many depth-first search graph algorithms in a
functional style, and proves their correctness using
algebraic methods.

Both are available from:

  http://www.cse.ogi.edu/~jl/biblio-functional.html  

Regards,
Koen.

--
Koen Claessen         http://www.cs.chalmers.se/~koen     
phone:+46-31-772 5424      mailto:[EMAIL PROTECTED]
-----------------------------------------------------
Chalmers University of Technology, Gothenburg, Sweden


Reply via email to