

Hashtables, a new Haskell library for fast mutable hash tables - T_S_
http://gregorycollins.net/posts/2011/06/11/announcing-hashtables

======
calebmpeterson
mutability in Haskell? I thought Haskell was purely functional i.e. lazy and
immutablility are foundational. Can someone clarify please?

~~~
dons
That's the default. There are, however, many other interesting computational
environments you might want to use, which Haskell let's you enable:
controlled, strict evaluation (the use of seq and rnf); local mutable state
(the `ST` monad); mutable state with transactions and rollbacks (the `STM`
monad); arbitrary effects on the world (the `IO` monad); computations with
backtracking (the `Logic` monad); deterministic parallelism with shared state
(the `Par` monad) and so on.

Just remember: in Haskell, persistent and immutable is the default. You turn
on other environments as you need them.

Why is it the default? So-called "purely functional" programming is a rich,
safe, environment for most programming problems, and makes lots of nice things
possible, such as trivial parallelization, automatic thread safety, proofs on
code via simple equational reasoning, and powerful optimizations.

~~~
alnayyir
Too bad they made lazy the default.

~~~
BasDirks
care to elaborate?

~~~
alnayyir
Space leaks.

Also, unpredictable program behavior (which nearly destroys its usefulness in
embedded beyond what perhaps Galois has been doing).

~~~
nandemo
For what is worth, Edward Yang is writing an excellent series on space leaks
in Haskell:

<http://blog.ezyang.com/2011/05/space-leak-zoo/>

The series require Haskell knowledge but this summary is fairly readable if
you have a good grounding on programming language theory and implementation.

