Thanks Wren, Thanks Dave ... a quick question though could you point me to an example where I could build up my own in place modifiable data structure in Haskell without using any standard library stuff?
For example, if I wanted an image representation such as this [[(Int,Int.Int)]] - basically a list of lists of 3 tuples (rgb) and wanted to do in place replacement to set the pixel values, how could I go about it. On Fri, Jul 16, 2010 at 9:47 AM, wren ng thornton <w...@freegeek.org> wrote: > C K Kashyap wrote: > >> Thanks Daniel, >> >> Better refactorability. >> >>> If you're using monadic style, changing from, say, >>> State Thing >>> to >>> StateT Thing OtherMonad >>> >>> or from >>> StateT Thing FirstMonad >>> to >>> StateT Thing SecondMonad >>> >>> typically requires only few changes. Explicit state-passing usually >>> requires more changes. >>> >> >> So, performance gain (runtime/memory) is not a side effect of Monadic >> style >> right? >> > > Generally speaking, right: monadic style won't improve performance. > > However, using monadic notation may allow you to change the backing monad > to a different representation of "the same" computation, thereby giving > asymptotic improvements[1]. However, the improvements themselves are coming > from the different representation; the use of monadic notation just allows > you to switch the representation without altering the code. > > > [1] > http://www.iai.uni-bonn.de/~jv/mpc08.pdf<http://www.iai.uni-bonn.de/%7Ejv/mpc08.pdf> > > -- > Live well, > ~wren > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- Regards, Kashyap
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe