[GHC] #1557: Enum/Ord derivations for System.Posix.Resource.Resource

2007-07-24 Thread GHC
#1557: Enum/Ord derivations for System.Posix.Resource.Resource --+- Reporter: Eelis| Owner: Type: feature request | Status: new Priority: normal |

Re: [GHC] #1393: Tag source tree with successful bootstraps

2007-07-24 Thread GHC
#1393: Tag source tree with successful bootstraps +--- Reporter: guest|Owner: Type: bug | Status: new Priority: normal |Milestone: _|_ Component: None

Re: [GHC] #1365: -fbyte-code is ignored in a OPTIONS_GHC pragma

2007-07-24 Thread GHC
#1365: -fbyte-code is ignored in a OPTIONS_GHC pragma +--- Reporter: mnislaih |Owner: Type: feature request | Status: new Priority: normal |Milestone: 6.10

Re: [GHC] #1215: GHC fails to respect the maximal munch rule while lexing qualified reservedids

2007-07-24 Thread GHC
#1215: GHC fails to respect the maximal munch rule while lexing qualified reservedids -+-- Reporter: Stefan O'Rear [EMAIL PROTECTED] |Owner: simonmar Type: bug |

OPTIONS_GHC -iMyDir

2007-07-24 Thread Greg Fitzgerald
I notice that some of GHC's command-line parameters do not work from within the OPTIONS_GHC pragma (6.6.1 on Windows). I can see how that makes sense for some parameters like --make, but what about -i and -v? Is this intentional or a bug? Can't specify the include path: {-# OPTIONS_GHC -iMyDir

Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-24 Thread Claus Reinke
though I'm extremely dubious about the utility of the Maybe patterns. actually, they are the main thing that interests me about view patterns!-) it connects them to the existing work on first-class patterns (where combinators over Maybe patterns do the matching work, and view patterns

Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-24 Thread Manuel Hernandez
Dear Haskellers, why is so difficult to define a function to compute the average of a list of numbers?? Warm regards!!! Man ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell

[Haskell] Re: View patterns in GHC: Request for feedback

2007-07-24 Thread Rene de Visser
Claus Reinke [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] though I'm extremely dubious about the utility of the Maybe patterns. actually, they are the main thing that interests me about view patterns!-) type Typ unit :: Typ - Maybe () arrow :: Type - Maybe

[Haskell] List averaging function [was: View patterns in GHC: Request for feedback]

2007-07-24 Thread Brent Yorgey
Hi Man, Difficult is a relative term -- with study and practice, what one once considered difficult can become easy. With that said, it is true that beginners to Haskell might find it difficult to define an average function correctly since Haskell is (for good reason) picky about numeric types.

Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-24 Thread Andreas Marth
I find that the suggested view pattern produce quite obfuscated code! I guess it sets the language barrier quite a bit higher. Do you really think a normal progrogrammer understands: insert x s@(has x - Just _) = s or: fib (np 2 - Just n) = fib (n + 1) + fib n or even: fib (np 2 = n) = fib (n + 1)

Re: [Haskell] Re: View patterns in GHC: Request for feedback

2007-07-24 Thread ajb
G'day all. Claus Reinke [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] type Typ unit :: Typ - Maybe () arrow :: Type - Maybe (Typ,Typ) size :: Typ - Integer size (unit - ()) = 1 size (arrow - (t1,t2)) = size t1 + size t2 The whole point of a view

Re: [Haskell-cafe] Weird ghci behaviour?

2007-07-24 Thread Philip Armstrong
On Mon, Jul 23, 2007 at 11:46:41AM -0700, Dan Piponi wrote: Ian said: Can you please give a complete testcase for the problem you're seeing? I took my test case and started deleting lines from it to simplify it. And now I'm not seeing the problem at all and I can't reproduce it, even though

[Haskell-cafe] Identifier generators with QuickCheck

2007-07-24 Thread J. Pablo Fernández
Hello Haskellers, I want to make a QuickCheck generator that creates identifiers, basically [a-zA-Z] as the first character and then [a-zA-Z0-9-_] for a total of 63 characters. So, I've got up to: do s - choose (1, 63 :: Int) elements validFirstChars where validFirstChars = ['a'..'z']

[Haskell-cafe] Re: Optimising UTF8-CString - String marshaling, plus comments on withCStringLen/peekCStringLen

2007-07-24 Thread Simon Marlow
Bayley, Alistair wrote: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stefan O'Rear fromUTF8Ptr unboxes fine for me with HEAD and 6.6.1. - the chr function tests that its Int argument is less than 1114111, before constructing the Char. It'd be nice to avoid this test. You

[Haskell-cafe] Re: Profiling and Threading: never the twain shall meet

2007-07-24 Thread Simon Marlow
Dougal Stanton wrote: It seems that profiling and threading are not supported at the same time in GHC6.6. At least, it objects to using both the flags at the same time, and there's a Trac entry for that issue. So I just wanted to be sure that I really need threading. I'm passing text through

[Haskell-cafe] RE: Optimising UTF8-CString - String marshaling, plus comments on withCStringLen/peekCStringLen

2007-07-24 Thread Bayley, Alistair
From: Simon Marlow [mailto:[EMAIL PROTECTED] http://darcs.haskell.org/takusen/Foreign/C/UTF8.hs In that code you have: | x = 0x0010 -- should be 0x001F I wasn't aware that the largest unicode code point had changed. Do you have a reference? Should we change

[Haskell-cafe] expension of fractions

2007-07-24 Thread Arie Groeneveld
Hi, I don't know if this is the right place to post this, but here I go. I translated a BC-program found on the home page of Keith Matthews, http://www.numbertheory.org/keith.html. It's about the expension of a (not necessarily reduced) fraction m/n in base b. Looking at the result of my

Re: [Haskell-cafe] Weird ghci behaviour?

2007-07-24 Thread Pepe Iborra
I can give the following partial explanation. When you run ghc test.hs it compiles your test file and produces some auxiliar files at the same time. When you run ghci afterwards, if the mod. date of the auxiliar files is more recent than that of the source file, it directly loads the

Re: [Haskell-cafe] Identifier generators with QuickCheck

2007-07-24 Thread Jonathan Cast
On Tuesday 24 July 2007, J. Pablo Fernández wrote: Hello Haskellers, I want to make a QuickCheck generator that creates identifiers, basically [a-zA-Z] as the first character and then [a-zA-Z0-9-_] for a total of 63 characters. So, I've got up to: do s - choose (1, 63 :: Int)

[Haskell-cafe] Dealing with large OOHaskell records

2007-07-24 Thread Scott West
Hello all, Does anyone have any experience with using large-ish (20 element) OOHaskell records? I'm finding that as the records get large, compile times get fairly ridiculous. Is there some explicit typing I should be doing to help the type-checker? Thanks! Scott

[Haskell-cafe] snoc vs cons

2007-07-24 Thread Eric
Does anyone know of a good article which discusses snoc vs cons lists? E. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: partitions of a multiset

2007-07-24 Thread Brent Yorgey
On 7/23/07, DavidA [EMAIL PROTECTED] wrote: Here's the approach I would try. 1. Use Data.List.group to group your multiset, eg [1,1,2] - [[1,1],[2]] 2. Now apply your partitions function to each of the groups [[1,1],[2]] - [ [([1,1],[]), ([1],[1]), ([],[1,1])], [([2],[]), ([],[2])] ] (Actually

Re: [Haskell-cafe] Re: Code and Perf. Data for Prime Finders (was: Genuine Eratosthenes sieve)

2007-07-24 Thread Melissa O'Neill
apfelmus wrote: After some pondering, the List a data structure for merging is really ingenious! :) Here's a try to explain how it works: Thanks apfelmus! A detailed explanation of this code is really helpful for anyone trying to understand what is going on. The VIP/ Crowd analogy is

Re: [Haskell-cafe] snoc vs cons

2007-07-24 Thread Derek Elkins
On Tue, 2007-07-24 at 17:34 +0100, Eric wrote: Does anyone know of a good article which discusses snoc vs cons lists? There's no reason to; there is no difference between a snoc list and a cons list. ___ Haskell-Cafe mailing list

[Haskell-cafe] Re: [Haskell] Re: View patterns in GHC: Request for feedback

2007-07-24 Thread Claus Reinke
unit :: Typ - Maybe () arrow :: Type - Maybe (Typ,Typ) size :: Typ - Integer size (unit - ()) = 1 size (arrow - (t1,t2)) = size t1 + size t2 Though I guess you would not object to: size (unit - Just ()) = 1 size (arrow - Just (t1,t2)) = size t1 + size t2 ? actually, i

Re: [Haskell-cafe] Re: partitions of a multiset

2007-07-24 Thread Pekka Karjalainen
On 7/24/07, Brent Yorgey [EMAIL PROTECTED] wrote: I'm not sure what a formal mathematical definition would be off the top of my head; but in Haskell, given a list L :: [a], I'm looking for all partitions P :: [[a]] where (sort . concat $ P) == (sort L). Here is quick attempt that requires Ord

Re: [Haskell-cafe] snoc vs cons

2007-07-24 Thread jerzy . karczmarczuk
Derek Elkins writes: On Tue, 2007-07-24 at 17:34 +0100, Eric wrote: Does anyone know of a good article which discusses snoc vs cons lists? There's no reason to; there is no difference between a snoc list and a cons list. Still, it (snoc) may be considered as a useful exercice in recursion,

[Haskell-cafe] RE: [Haskell] View patterns in GHC: Request for feedback

2007-07-24 Thread Simon Peyton-Jones
| At the risk of being a spoil-sport, I have a somewhat negative take on | view patterns. Not because I think they're particularly bad, but | because I don't think they're significantly useful enough to warrant | adding to the language, at least if we also have pattern guards. Syntactic sugar is

[Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-24 Thread apfelmus
Simon Peyton-Jones wrote: Views have been the subject of rather inconclusive debate for a long time, certainly since the inception of Haskell. I'm thinking of pattern views as a way to break the logjam by implementing something that is a reasonable stab, and seeing whether it sticks. I thought

Re: [Haskell-cafe] Re: partitions of a multiset

2007-07-24 Thread Brent Yorgey
On 7/24/07, Pekka Karjalainen [EMAIL PROTECTED] wrote: On 7/24/07, Brent Yorgey [EMAIL PROTECTED] wrote: given a list L :: [a], I'm looking for all partitions P :: [[a]] where (sort . concat $ P) == (sort L). Here is quick attempt that requires Ord [a] and expects a sorted list. It may very

[Haskell-cafe] Space usage and CSE in Haskell

2007-07-24 Thread Melissa O'Neill
When advocating functional languages like Haskell, one of the claims I've tended to make is that referential transparency allows the language to be much more aggressive about things like common subexpression elimination (CSE) than traditional imperative languages (which need to worry about

Re: [Haskell-cafe] Re: Code and Perf. Data for Prime Finders (was: Genuine Eratosthenes sieve)

2007-07-24 Thread Thorkil Naur
Hello Melissa, On Tuesday 24 July 2007 19:09, Melissa O'Neill wrote: apfelmus wrote: After some pondering, the List a data structure for merging is really ingenious! :) Here's a try to explain how it works: Thanks apfelmus! A detailed explanation of this code is really helpful

Re: [Haskell-cafe] Space usage and CSE in Haskell

2007-07-24 Thread Dan Weston
But this simple modification allows us to use only O(sqrt(n)) space at the point we print the nth prime: I wouldn't call your modification simple. It appears that you are trying to put smarts into the garbage collector and memoization logic, the first step towards a priority queue of

Re: [Haskell-cafe] Space usage and CSE in Haskell

2007-07-24 Thread Dan Weston
I think I might not have been lazy enough to get proper memoization. This might be needed: firstNprimes :: Nat - [Integer] firstNprimesZero = [] firstNprimes ( Succ $ Zero) = let p = firstNprimes Zero in 2 : p firstNprimes (Succ . Succ $ Zero) = let p

[Haskell-cafe] GHC and GLUT

2007-07-24 Thread Paul L
I wonder if anybody has experience with the GLUT library that GHC currently supports? I was trying to use freeglut because I need the actionOnWindowClose function. GHC documentation seems to indicate it's possible to do this, but my effort isn't successful. I even replaced the system-wide

RE: [Haskell-cafe] Space usage and CSE in Haskell

2007-07-24 Thread Simon Peyton-Jones
Melissa You might find chapter 23 The pragmatics of graph reduction in my 1987 book worth a look. It gives other examples where CSE can be harmful. Simon | -Original Message- | From: [EMAIL PROTECTED] [mailto:haskell-cafe- | [EMAIL PROTECTED] On Behalf Of Melissa O'Neill | Sent: 24