[Haskell] Re: ST/STRef vs. IO/IORef

Bulat Ziganshin bulatz at HotPOP.com
Fri Aug 5 05:13:06 EDT 2005

Hello Till,

Friday, August 05, 2005, 10:04:53 AM, you wrote:

TM>                MonadState  IOArray IOArray          ST
TM>                with                with             with
TM>                FiniteMap           unsafePerformIO  MutArr

TM> safe           yes        yes         no            yes

TM> efficient      no         yes         yes           yes

afaik, ST efficient only with small enough arrays. one time i tried
STArray of about 100 000 elements and seen that things goes much worse
than in IO monad with IOArray. on small arrays STArray performs good

(i was trying to create sorting routine. afair, it was an insert sort)

Best regards,
 Bulat                            mailto:bulatz at HotPOP.com

More information about the Haskell mailing list