Personal tools

Monad/ST

From HaskellWiki

< Monad(Difference between revisions)
Jump to: navigation, search
(Added some explanations of what this Monad does from #haskell.)
 
Line 1: Line 1:
Some explanations from #haskell ([http://tunes.org/~nef/logs/haskell/07.02.07 log] see 21:04):
+
Some explanations from #haskell (see 13:05:37 in the [http://tunes.org/~nef/logs/haskell/07.02.07 log] ):
   
 
TuringTest: ST lets you implement algorithms that are much more efficient with mutable memory used internally. But the whole "thread" of computation cannot exchange mutable state with the outside world, it can only exchange immutable state.
 
TuringTest: ST lets you implement algorithms that are much more efficient with mutable memory used internally. But the whole "thread" of computation cannot exchange mutable state with the outside world, it can only exchange immutable state.
  +
  +
TuringTest: chessguy: You pass in normal Haskell values and then use ST to allocate mutable memory, then you initialize and play with it, then you put it away and return a normal Haskell value.
   
 
sjanssen: a monad that has mutable references and arrays, but has a "run" function that is referentially transparent
 
sjanssen: a monad that has mutable references and arrays, but has a "run" function that is referentially transparent

Revision as of 21:12, 7 February 2007

Some explanations from #haskell (see 13:05:37 in the log ):

TuringTest: ST lets you implement algorithms that are much more efficient with mutable memory used internally. But the whole "thread" of computation cannot exchange mutable state with the outside world, it can only exchange immutable state.

TuringTest: chessguy: You pass in normal Haskell values and then use ST to allocate mutable memory, then you initialize and play with it, then you put it away and return a normal Haskell value.

sjanssen: a monad that has mutable references and arrays, but has a "run" function that is referentially transparent

emu: in-place qsort within ST monad: http://hpaste.org/274