On a related topic, is there a good way to have strict
strings. Should I just create my own type or is there
something already in the library.
Here is my situation: I have a state monad. It seems to me that
if states are built out of lazy types, then there may be many
states all live at the same time, thus blowing up the space.
But deep in my state data types, I have strings. Also some
monad operations return strings. So I need strict strings.
In case I haven't made this clear, here is an example:
example =
do some_string <- a_function_of_state
modify_the_state
modify_the_state_some_more
do_something_with_a_string some_string
Now if I run example on a state s0, then s0 will be live throughout
the execution of example, whereas, if "a_function_of_state" returned
a completely evaluated data structure and a completely updated the
state, then the parts of s0 that are not shared should be collectable.
Cheers,
Theo Norvell
----------------------------
Dr. Theodore Norvell, Assistant Professor [EMAIL PROTECTED]
Memorial University of Newfoundland http://www.engr.mun.ca/~theo