Re: [Haskell-cafe] Debugging partial functions by the rules

2006-11-14 Thread Matthias Fischmann
On Wed, Nov 15, 2006 at 03:54:31PM +1100, Donald Bruce Stewart wrote: > To: glasgow-haskell-users@haskell.org > Cc: haskell-cafe@haskell.org > From: Donald Bruce Stewart <[EMAIL PROTECTED]> > Date: Wed, 15 Nov 2006 15:54:31 +1100 > Subject: [Haskell-cafe] Debugging partial functions by the rules >

[Haskell-cafe] Debugging partial functions by rewriting ...

2006-11-14 Thread Donald Bruce Stewart
Ok, so I took the rule rewriting idea and added a preprocessor instead, that inserts 'assert's for you, currently just for head,tail and fromJust. This program, for example: module Main where import qualified Data.Map as M import Data.Maybe main = do print f f = let m = M.f

Re: [Haskell-cafe] Debugging partial functions by the rules

2006-11-14 Thread Jason Dagit
On 11/14/06, Donald Bruce Stewart <[EMAIL PROTECTED]> wrote: So, further work: * have 'assert' respected when -O is on * think up a technique for splicing in 'assert' via rewrite rules (or TH ...) such that the src locations are expanded after the rewrite, and correctly reflect the

[Haskell-cafe] Debugging partial functions by the rules

2006-11-14 Thread Donald Bruce Stewart
So all this talk of locating head [] and fromJust failures got me thinking: Couldn't we just use rewrite rules to rewrite *transparently* all uses of fromJust to safeFromJust, tagging the call site with a location? To work this requires a few things to go right: * a rewrite rule

Re: [Haskell-cafe] pleac, examples, etc

2006-11-14 Thread Cale Gibbard
On 14/11/06, chris moline <[EMAIL PROTECTED]> wrote: --- brad clawsie <[EMAIL PROTECTED]> wrote: > it would be great if some of the more informed > posters here took a stab > at filling in > > http://pleac.sourceforge.net/pleac_haskell/index.html > > a neat site for cookbook-style problem solving

Re: [Haskell-cafe] Haskell Debugging

2006-11-14 Thread Cale Gibbard
On 14/11/06, Cale Gibbard <[EMAIL PROTECTED]> wrote: On 14/11/06, Valentin Gjorgjioski <[EMAIL PROTECTED]> wrote: > Just one more thing > > If I write > > ex9 :: [Float] > ex9 = (observe "after reverse" ) reverse [10.0,7.0,3.0,0.0,4.0] > > it doesn't work. If I delete ex9 :: [Float] then it wor

Re: [Haskell-cafe] Haskell Debugging

2006-11-14 Thread Cale Gibbard
On 14/11/06, Valentin Gjorgjioski <[EMAIL PROTECTED]> wrote: Just one more thing If I write ex9 :: [Float] ex9 = (observe "after reverse" ) reverse [10.0,7.0,3.0,0.0,4.0] it doesn't work. If I delete ex9 :: [Float] then it works fine. any suggestions? This doesn't happen for me. The only t

Re: [Haskell-cafe] what GUI library should i select?

2006-11-14 Thread Duncan Coutts
On Wed, 2006-11-15 at 01:29 +, Neil Mitchell wrote: > > The funny thing is that we can actually use Haskell threads with Gtk2Hs > > perfectly well with the single threaded rts (we currently use a polling > > scheme to to cooperative scheduling between gtk+ and ghc rts but there > > are some no

Re: [Haskell-cafe] what GUI library should i select?

2006-11-14 Thread Neil Mitchell
Hi Plan 1: prevent gtk2hs initialising when using the threaded RTS. This is what the dev version does at the moment to prevent people shooting themselves in the foot. The funny thing is that we can actually use Haskell threads with Gtk2Hs perfectly well with the single threaded rts (we current

Re: [Haskell-cafe] Haskell Debugging

2006-11-14 Thread Valentin Gjorgjioski
On 14.11.2006 23:17 Cale Gibbard wrote: On 13/11/06, Valentin Gjorgjioski <[EMAIL PROTECTED]> wrote: Following example import Hugs.Observe ex8 :: [Float] ex8 = (observe "after reverse" ) reverse [10.0,7.0,3.0,0.0,4.0] gives me >ex8 [4.0,0.0,3.0,7.0,10.0] >>> Observations << aft

RE: [Haskell-cafe] what GUI library should i select?

2006-11-14 Thread Duncan Coutts
On Tue, 2006-11-14 at 10:40 +, Simon Peyton-Jones wrote: > I wonder whether it'd be possible to make the gtk2hs stuff emit > warnings if you make calls from two different threads? Then an > application would complain constructively rather than "becoming > unstable". I have three plans: Plan

Re: [Haskell-cafe] pleac, examples, etc

2006-11-14 Thread chris moline
--- brad clawsie <[EMAIL PROTECTED]> wrote: > it would be great if some of the more informed > posters here took a stab > at filling in > > http://pleac.sourceforge.net/pleac_haskell/index.html > > a neat site for cookbook-style problem solving What I've always found funny about pleac is that n

Re: [Haskell-cafe] Haskell Debugging

2006-11-14 Thread Cale Gibbard
On 13/11/06, Valentin Gjorgjioski <[EMAIL PROTECTED]> wrote: I'm pretty new in Haskell, few days since I started learning it. I want to debu my programs. I'm currently using WinHugs, and I prefer debugger for this. I tried googling and I found Hugs.Observer. I like it how it works, but still I

Re: [Haskell-cafe] pleac, examples, etc

2006-11-14 Thread Pixel
Spencer Janssen <[EMAIL PROTECTED]> writes: > Please do not use the PLEAC Haskell cookbook for learning Haskell. The > author redefined many of the standard operators to produce code that isn't > standard Haskell. > > Here are some choice snippets from the first chapter: > > Now, we all know th

[Haskell-cafe] the case of the 100-fold program speedup

2006-11-14 Thread Seth Gordon
One of Alan Perlis's "Epigrams in Programming" is "A language that doesn't affect the way you think about programming, is not worth knowing". I recently had an experience that demonstrated this principle. I had to write some code that took a polygon (encoded in WKT, a standard format for geograph

Re: [Haskell-cafe] Re: Great language shootout: reloaded

2006-11-14 Thread Bulat Ziganshin
Hello Simon, Tuesday, November 14, 2006, 4:31:27 PM, you wrote: > Sure, since gzip is the metric, then we can optimise for that. For example, > instead of writing a higher-order function, just copy it out N times > instantiating the higher-order argument differently each time. There should >

[Haskell-cafe] Re: what GUI library should i select?

2006-11-14 Thread Chung-chieh Shan
Simon Peyton-Jones <[EMAIL PROTECTED]> wrote in article <[EMAIL PROTECTED]> in gmane.comp.lang.haskell.cafe: > I wonder whether it'd be possible to make the gtk2hs stuff emit > warnings if you make calls from two different threads? Then an > application would complain constructively rather than "

[Haskell-cafe] Re: Great language shootout: reloaded

2006-11-14 Thread Simon Marlow
Sebastian Sylvan wrote: On 11/10/06, Henk-Jan van Tuyl <[EMAIL PROTECTED]> wrote: On Fri, 10 Nov 2006 01:44:15 +0100, Donald Bruce Stewart <[EMAIL PROTECTED]> wrote: > So back in January we had lots of fun tuning up Haskell code for the > Great Language Shootout[1]. We did quite well at the t

Re[2]: [Haskell-cafe] what GUI library should i select?

2006-11-14 Thread Bulat Ziganshin
Hello Dmitry, Tuesday, November 14, 2006, 1:26:36 PM, you wrote: >> it is what i say about. threaded RTS + multipls threads that does >> computations + one thread that interfaces with Gtk2Hs. afaiu, the only >> problem is that i need to manage both Gtk events and periodically >> check queue of co

Re: [Haskell-cafe] what GUI library should i select?

2006-11-14 Thread Sebastian Sylvan
On 11/14/06, Dmitry V'yal <[EMAIL PROTECTED]> wrote: Bulat Ziganshin wrote: > it is what i say about. threaded RTS + multipls threads that does > computations + one thread that interfaces with Gtk2Hs. afaiu, the only > problem is that i need to manage both Gtk events and periodically > check que

Re: [Haskell-cafe] deepSeq vs rnf

2006-11-14 Thread Simon Marlow
Björn Bringert wrote: Cale Gibbard wrote: On 22/10/06, Chad Scherrer <[EMAIL PROTECTED]> wrote: Hi, I had posted this question a while back, but I think it was in the middle of another discussion, and I never did get a reply. Do we really need both Control.Parallel.Strategies.rnf and deepSeq

Re: [Haskell-cafe] what GUI library should i select?

2006-11-14 Thread Dmitry V'yal
Duncan Coutts wrote: > The problem at the moment with GUIs and GHC's threaded RTS is that there > is now way to specify that all the Haskell threads that want to do GUI > stuff must run on a single OS thread. It's not impossible to solve but > it requires either more support from the RTS or it nee

Re: [Haskell-cafe] what GUI library should i select?

2006-11-14 Thread Dmitry V'yal
Bulat Ziganshin wrote: > it is what i say about. threaded RTS + multipls threads that does > computations + one thread that interfaces with Gtk2Hs. afaiu, the only > problem is that i need to manage both Gtk events and periodically > check queue of commands from other threads, but using timer + Ch

Re: [Haskell-cafe] what GUI library should i select?

2006-11-14 Thread Dmitry V'yal
Iván Pérez Domínguez wrote: > I'm using Gentoo Linux. We obviously don't use prebuilt packaged > versions, but installing it is just doing "emerge wxhaskell" and > 'playing the... waiting game'. Gtk2hs support under Gentoo is mostly > missing (the package is included, but doesn't work at all). Hm

RE: [Haskell-cafe] what GUI library should i select?

2006-11-14 Thread Simon Peyton-Jones
I wonder whether it'd be possible to make the gtk2hs stuff emit warnings if you make calls from two different threads? Then an application would complain constructively rather than "becoming unstable". Simon | -Original Message- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Be