Re: [Haskell-cafe] lazy A-star search

2011-10-30 Thread Eugene Kirpichov
Anton, I think the mapM inside searchBy is incorrect. You're threading state between exploration of different branches, which you I think shouldn't be doing. 30.10.2011, в 19:44, Anton Kholomiov написал(а): > I'm misunderstanding astar. I've thought that 'whole route'-heuristic > will preven

Re: [Haskell-cafe] Efficient mutable arrays in STM

2011-10-30 Thread David Barbour
On Sun, Oct 30, 2011 at 6:20 PM, Ben Franksen wrote: > According to the original STM paper the implementation does an equality > test, albeit only for pointer equality. It strikes me as bad form to depend on characteristics of `the implementation`. An incremented integer would probably be ok,

Re: [Haskell-cafe] Efficient mutable arrays in STM

2011-10-30 Thread Ben Franksen
Benjamin Franksen wrote: > David Barbour wrote: >> Create an extra TVar Int for every `chunk` in the array (e.g every 256 >> elements, tuned to your update patterns). Read-write it (increment it, be >> sure to force evaluation) just before every time you write an element or >> slice it or slice the

Re: [Haskell-cafe] lazy A-star search

2011-10-30 Thread wren ng thornton
On 10/30/11 11:44 AM, Anton Kholomiov wrote: I'm misunderstanding astar. I've thought that 'whole route'-heuristic will prevent algorithm from going in circles. The more you circle around the more the whole route distance is. Thank you for showing this. There are multiple things involved in A*.

Re: [Haskell-cafe] MonadPlus versus Alternative

2011-10-30 Thread wren ng thornton
On 10/29/11 11:02 PM, Gregory Crosswhite wrote: Hey everyone, What is the difference between MonadPlus and Alternative? In my mind, it would make sense for the difference to be that the former provides "and" semantics (i.e., x `mplus` y means do both x and y) whereas the latter provides "or"

Re: [Haskell-cafe] control-c only caught once -- bug?

2011-10-30 Thread Donn Cave
Quoth Brian Johnson , ... > On further thought, there is something sensible here: the RTS might crash > while trying to exit. I propose, for POSIX environments, the following > change to SIGINT handling: > > * SIGINT is transformed into UserInterrupt during normal program execution > * Once the RT

Re: [Haskell-cafe] ANN: Haskell OpenGL package updates

2011-10-30 Thread Edward Kmett
The biggest problem with the RULES based approach is that if you are in a context where the RULES don't or can't fire, then your semantics silently change. This leads to subtle bugs which only show up in ghci, etc. On Friday, October 28, 2011, Jason Dagit wrote: > On Fri, Oct 28, 2011 at 2:07 PM,

Re: [Haskell-cafe] lazy A-star search

2011-10-30 Thread Anton Kholomiov
I'm misunderstanding astar. I've thought that 'whole route'-heuristic will prevent algorithm from going in circles. The more you circle around the more the whole route distance is. Thank you for showing this. Here is an updated version. searchBy function contains a state. State value accumulates vi

Re: [Haskell-cafe] MonadPlus versus Alternative

2011-10-30 Thread Sean Leather
On Sun, Oct 30, 2011 at 04:02, Gregory Crosswhite wrote: > So is there any difference between the interpretation of MonadPlus and > Alternative, or is the only difference between them that the former applies > to Monad whereas the latter applies to Applicative? > Somewhat OT, but this led me to p

Re: [Haskell-cafe] ANN: Monad.Reader Issue 19

2011-10-30 Thread Iustin Pop
On Wed, Oct 26, 2011 at 03:17:47PM -0400, Brent Yorgey wrote: > I am pleased to announce that Issue 19 of The Monad.Reader, a special > issue on parallelism and concurrency, is now available: > > http://themonadreader.files.wordpress.com/2011/10/issue19.pdf Thanks a lot for the TMR, it's a plea

Re: [Haskell-cafe] Package documentation complaints -- and a suggestion

2011-10-30 Thread Malcolm Wallace
> The problem isn't social pressure to be stable, it's the ambiguity of what > "stable" means. If Hackage 2 institutes a policy whereby things claiming to > be stable are treated better, then "stable" is likely to become the new > "experimental". I'd say, rather than rely on social agreement o