Turtle Wizard <
0wl256...@gmail.com> writes:
> I was wondering how one could write this scheme program in
> a good haskell sense:
Haskell is not Scheme and it doesn't cleanly support every possible
Scheme programming style. In particular, straightforward mappings of
your dispatch vector to Haskell won't work, because the functions don't
have similar type signatures. If you had to, you could write all the
functions as IO or ST actions, represent cons nodes as IORef or STRef
containers, etc. Could you instead say how you'd actually want to use
that function? Otherwise your question sounds sort of like a C
programmer asking how to turn off the Scheme garbage collector.
You might look for the article "write yourself a Scheme in 48 hours".