[magnus@galois.com: Re: [Haskell-cafe] Monads for Incremental computing]

Magnus writes: Thanks to Peter Jonsson, the source is now on hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Adaptive Cheers, Magnus Donnie Jones wrote:
Hello sanzhiyan,
I believe this is the same paper, the pdf is available here: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.8.3014
Cheers. __ Donnie
On Thu, Nov 13, 2008 at 9:02 PM, Don Stewart
mailto:dons@galois.com> wrote: I sit next to the author, CC'd.
-- Don
sanzhiyan: > I'm looking for the source code of the library for adaptive computations > exposed in Magnus Carlsson's "Monads for Incremental Computing"[1], but > the link in the paper is broken. > So, does anyone have the sources or knows how to contact the author? > > [1] http://portal.acm.org/citation.cfm?id=581482
> _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
----- End forwarded message -----

As Magnus pointed out in his (very clever) paper, the Applicative interface
allows for more precise/efficient tracking of dependencies, in that it
eliminates accidental sequentiality imposed by the Monad interface. (Magnus
didn't mention Applicative by name, as his paper preceded
Idiom/Applicative.) However, I don't see an Applicative instance in the
library.
- Conal
On Thu, Nov 13, 2008 at 7:46 PM, Don Stewart
Magnus writes:
Thanks to Peter Jonsson, the source is now on hackage:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Adaptive
Cheers, Magnus
Donnie Jones wrote:
Hello sanzhiyan,
I believe this is the same paper, the pdf is available here: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.8.3014
Cheers. __ Donnie
On Thu, Nov 13, 2008 at 9:02 PM, Don Stewart
mailto:dons@galois.com> wrote: I sit next to the author, CC'd.
-- Don
sanzhiyan: > I'm looking for the source code of the library for adaptive computations > exposed in Magnus Carlsson's "Monads for Incremental Computing"[1], but > the link in the paper is broken. > So, does anyone have the sources or knows how to contact the author? > > [1] http://portal.acm.org/citation.cfm?id=581482
> _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
----- End forwarded message ----- _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

2008/11/13 Conal Elliott
As Magnus pointed out in his (very clever) paper, the Applicative interface allows for more precise/efficient tracking of dependencies, in that it eliminates accidental sequentiality imposed by the Monad interface. (Magnus didn't mention Applicative by name, as his paper preceded Idiom/Applicative.) However, I don't see an Applicative instance in the library.
I was wondering about that, actually. The specialized Applicative instance mentioned in the paper adds an additional storage cell to the computation graph. I would expect that for simple computations, using the applicative instance could perform worse than "naive" monadic code. For example, given three adaptive references "ref1", "ref2", and "ref3" :: Adaptive Int do a <- ref1 b <- ref2 c <- ref3 return (a+b+c) This computation adds three "read" nodes to the current "write" output. But this code: do (\a b c -> a + b + c) <$> read ref1 <*> read ref2 <*> read ref3 using (<*>) = the enhanced version of "ap" from the paper. I believe this would allocate additional cells to hold the results of the function partially applied to the intermediate computations. Overall I think this would not be a win in this case. But it is also easy to construct cases where it *is* a win. I suppose you can allow the user to choose one or the other, but my general expectation for Applicative is that (<*>) should never perform *worse* than code that uses Control.Monad.ap Is this the right understanding, or am I totally missing something from the Adaptive paper? -- ryan
participants (3)
-
Conal Elliott
-
Don Stewart
-
Ryan Ingram