[Haskell-cafe] Monads with "The" contexts?

Tillmann Rendel rendel at informatik.uni-marburg.de
Thu Jul 12 20:23:45 CEST 2012


Hi,

Takayuki Muranushi wrote:
>> sunPerMars :: [Double]
>> sunPerMars = (/) <$> sunMass <*> marsMass
>
> Sadly, this gives too many answers, and some of them are wrong because
> they assume different Earth mass in calculating Sun and Mars masses,
> which led to inconsistent calculation.

This might be related to the problem adressed by Sebastian Fischer, Oleg 
Kiselyov and Chung-chieh Shan in their ICFP 2009 paper on purely 
functional lazy non-deterministic programming.

   http://www.cs.rutgers.edu/~ccshan/rational/lazy-nondet.pdf

An implementation seems to be available on hackage.

   http://hackage.haskell.org/package/explicit-sharing

Tillmann



More information about the Haskell-Cafe mailing list