[Shootout-list] Re: Haskell killer prodcons implementation - fair?
Aaron Denney
wnoise@ofb.net
Sat, 2 Oct 2004 18:24:23 -0600
> Just out of curiousity, can an MVar be such that it could hold several
> values (e.g., a string, or a structure of some kind)?
Sure. MVars can hold any data value. Just make an "MVar String" instead
of an "MVar Int", or an "MVar (MyParametrizedDataStructure Int Int)", or
even pass functions over them...
Hmm. Actually, stuffing certain values through MVars might be
a reasonable way to keep GHC from overoptimizing.
If you need depth greater than one, use channels of type "Chan a"
instead.
Since the ring-message one doesn't, I suppose I should see if I get any
speedup with MVar instead.
--
Aaron Denney
-><-