Suggestion for bang patterns documentation

2009-02-26 Thread Brian Bloniarz
I got confused by the GHC documentation recently, I was wondering how it could be improved. From: http://www.haskell.org/ghc/docs/latest/html/users_guide/bang-patterns.html > A bang only really has an effect if it precedes a variable or wild-card > pattern: > f3 !(x,y) = [x,y] > f4 (x,y) = [x,y

Re: Type (class) recursion + families = exponential compile time?

2009-02-26 Thread Ben Lippmeier
Here's the reference http://portal.acm.org/citation.cfm?id=96748 "Deciding ML typability is complete for deterministic exponential time" -- Harry G. Mairson. Ben. On 27/02/2009, at 10:12 AM, Ben Franksen wrote: Hi the attached module is a much reduced version of some type-level assura

Re: Int vs Word performance?

2009-02-26 Thread Don Stewart
claus.reinke: > Looking at prelude/PrelRules.hs has reminded me of an old > conundrum: if I switch from Int to Word, should I expect any > performance differences? > > A while ago, I needed lots of fairly small positive numbers, > together with a small number of flags for each, so I thought > I'd s

Re: Type (class) recursion + families = exponential compile time?

2009-02-26 Thread Lennart Augustsson
Just Hindley-Milner type inference is exponential, making the type system more complex isn't going to make things better. 2009/2/26 Ben Franksen : > Hi > > the attached module is a much reduced version of some type-level assurance > stuff (inspired by the Lightweight Monadic Regions paper) I am tr

Int vs Word performance?

2009-02-26 Thread Claus Reinke
Looking at prelude/PrelRules.hs has reminded me of an old conundrum: if I switch from Int to Word, should I expect any performance differences? A while ago, I needed lots of fairly small positive numbers, together with a small number of flags for each, so I thought I'd switch from Int to Word, an

Type (class) recursion + families = exponential compile time?

2009-02-26 Thread Ben Franksen
Hi the attached module is a much reduced version of some type-level assurance stuff (inspired by the Lightweight Monadic Regions paper) I am trying to do. I am almost certain that it could be reduced further but it is late and I want to get this off my desk. Note the 4 test functions, test11 .. t

Re: optimization and rewrite rules questions

2009-02-26 Thread Claus Reinke
but if we unfold a loop combinator at compile time, GHC's normal optimizations can take over from there): http://www.haskell.org/pipermail/haskell-cafe/2009-February/056241.html Just a note - there is a solution that doesn't require Template Haskell which I use in my own code. Here is a sketch:

Re: optimization and rewrite rules questions

2009-02-26 Thread Claus Reinke
| II is where I'd like to be able to distinguish variables, constants, | and complex expressions in the left-hand sides of RULES, and | I and III are where I'd like control over the rewrite strategy, as | in strategy combinators. I'm deep in icfp submissions, so no time to reply properly. Okay

Re: optimization and rewrite rules questions

2009-02-26 Thread Max Bolingbroke
2009/2/24 Claus Reinke : > In the recently burried haskell-cafe thread "speed: ghc vs gcc", > Bulat pointed out some of the optimizations that GHC doesn't > do, such as loop unrolling. I suggested a way of experimenting with loop > unrolling, using template haskell to bypass GHC's blindspot (it usu

RE: optimization and rewrite rules questions

2009-02-26 Thread Simon Peyton-Jones
| II is where I'd like to be able to distinguish variables, constants, | and complex expressions in the left-hand sides of RULES, and | I and III are where I'd like control over the rewrite strategy, as | in strategy combinators. I'm deep in icfp submissions, so no time to reply properly. You can

finally part run twice on Ctrl-C

2009-02-26 Thread Neil Mitchell
Hi, I've got the following code: import Control.Exception import System.Cmd main = system "sleep 1m" `finally` putStrLn "goodbye" When compiled with GHC 6.10.1.20090225, if I hit Ctrl-C during the sleep, I get the goodbye printed twice. If I leave evaluation to finish normally I get goodbye once