Re: [GHC] #398: Xlib Types Not Instances of Anything

2006-01-08 Thread GHC
#398: Xlib Types Not Instances of Anything +--- Reporter: jcast | Owner: ross Type: bug| Status: closed Priority: normal | Milestone:

Re: cvs commit: fptools/libraries/base/Data IntMap.hs Map.hs Sequence.hs Set.hs fptools/libraries/base/Data/Generics Instances.hs Twins.hs

2006-01-08 Thread Jim Apple
Simon Peyton Jones wrote: simonpj 2006/01/06 07:51:23 PST Modified files: libraries/base/Data IntMap.hs Map.hs Sequence.hs Set.hs libraries/base/Data/Generics Instances.hs Twins.hs Log: Eta-expand some higher-rank functions. GHC is about to move to *invariant* rather

Re: [Haskell] A collection of related proposals regarding monads

2006-01-08 Thread Cale Gibbard
On 05/01/06, John Meacham [EMAIL PROTECTED] wrote: independent of anything else, giving up error messages on pattern match failures in do notation is not acceptable. so, if the split were to happen, having two methods in MonadZero, one which takes a string argument, would be needed.

Re: [Haskell] Re: ANN: HDBC (Haskell Database Connectivity)

2006-01-08 Thread Keean Schupke
My solution to this when developing a database library for my own use was to define the API in a bracket notation style, and only provide safe functions. The idea is that the function obtains the resource, calls a function passed as an argument, then frees the resource, so all resouces are

[Haskell] Parsing bug in GHC 6.4.1 ?

2006-01-08 Thread Bruno Oliveira
Hello, The following class definition: class Foo o where (:+) :: o - o - o and even the following function definition: bar f (x,y) = x :+ y are accepted by GHC. However, when I try to create one instance of Foo: instance Foo Int where x :+ y = x + y I get the following error

Re: [Haskell] Parsing bug in GHC 6.4.1 ?

2006-01-08 Thread Cale Gibbard
On 08/01/06, Bruno Oliveira [EMAIL PROTECTED] wrote: Hello, The following class definition: class Foo o where (:+) :: o - o - o and even the following function definition: bar f (x,y) = x :+ y are accepted by GHC. However, when I try to create one instance of Foo: instance

[Haskell] Re: Parsing bug in GHC 6.4.1 ?

2006-01-08 Thread Peter Simons
Bruno Oliveira writes: class Foo o where (:+) :: o - o - o The Haskell report specifies in section 2.4 Identifiers and Operators: An operator symbol starting with a colon is a constructor. Think of ':' as a character that is interpreted as uppercase; you can't use it to start a

Re: [Haskell] Re: Parsing bug in GHC 6.4.1 ?

2006-01-08 Thread Cale Gibbard
On 08/01/06, Bruno Oliveira [EMAIL PROTECTED] wrote: On 08 Jan 2006 16:37:47 +0100, Peter Simons wrote: Bruno Oliveira writes: class Foo o where (:+) :: o - o - o The Haskell report specifies in section 2.4 Identifiers and Operators: An operator symbol starting with a colon is a

[Haskell] New look for haskell.org: MediaWiki

2006-01-08 Thread John Peterson
As everyone has noticed during the making Haskell more open discussion, MediaWiki was suggested as a better wiki technology for haskell.org. Ashley Yakeley has generously installed MediaWiki and we would like to migrate the main pages of haskell.org into this wiki. The migration is not complete -

Re: [Haskell] New look for haskell.org: MediaWiki

2006-01-08 Thread Neil Mitchell
wiki is under the GNU FDL so the licenses are not necessarily compatible. As far as I understand, this means that if I see a sample of code on the haskell wiki, and just want to steal it for my project, I'm not allowed to, unless I also release my code under the GNU FDL? And another point,

Re: [Haskell] New look for haskell.org: MediaWiki

2006-01-08 Thread John Peterson
wiki is under the GNU FDL so the licenses are not necessarily compatible. As far as I understand, this means that if I see a sample of code on the haskell wiki, and just want to steal it for my project, I'm not allowed to, unless I also release my code under the GNU FDL? This is something

Re: [Haskell] New look for haskell.org: MediaWiki

2006-01-08 Thread Neil Mitchell
This is something worth debating. Certainly you can ask the author of the code for permission to use it but this is an extra burden. Would be nice to have a special wiki construct to mark content as posessing an extra license. The whole license debate should take place as soon as possible

[Haskell] License for haskell.org content

2006-01-08 Thread John Peterson
I believe the scenario that the FDL addresses is that someone (probably Paul Hudak!) borrows massive amounts of stuff from the wiki, adds his own good stuff, and then publishes a nice book or something without having to share his additional contribution. Some people would like to be sure that

Re: [Haskell] New look for haskell.org: MediaWiki

2006-01-08 Thread Anders Höckersten
sön 2006-01-08 klockan 21:12 -0500 skrev John Peterson: wiki is under the GNU FDL so the licenses are not necessarily compatible. As far as I understand, this means that if I see a sample of code on the haskell wiki, and just want to steal it for my project, I'm not allowed to, unless I

[Haskell] Re: License for haskell.org content

2006-01-08 Thread Ashley Yakeley
In article [EMAIL PROTECTED], Ian Lynagh [EMAIL PROTECTED] wrote: Why not use the GPL, then? FWIW, the GFDL is considered non-free by Debian[1], so that would mean any documentation or anything derived from the wiki couldn't be packaged for Debian. Apart from the issue of code itself on

RE: [Haskell-cafe] x86 code generation going wrong?

2006-01-08 Thread Branimir Maksimovic
From: Chris Kuklewicz [EMAIL PROTECTED] To: haskell-cafe@haskell.org Subject: [Haskell-cafe] x86 code generation going wrong? Date: Sat, 07 Jan 2006 16:18:59 + Hello, I need to ask for some help to test x86 code generation. There is a factor of two runtime difference between the code

Re: [Haskell-cafe] do {x-[1,2,3]; True - return (odd x); return x}.. why? (do notation, monads, guards)

2006-01-08 Thread Bulat Ziganshin
Hello Marc, Sunday, January 08, 2006, 3:19:56 AM, you wrote: MW list2=do { x - [1,2,3]; guard (odd x); return x} -- - provided by xerox list3 = [ x | x - [1,2,3], odd x] -- Best regards, Bulatmailto:[EMAIL PROTECTED]

Re[2]: [Haskell-cafe] fastest Binary library!

2006-01-08 Thread Bulat Ziganshin
Hello Donald, Sunday, January 08, 2006, 3:43:51 AM, you wrote: and got the (de)serialization speed about 50 mb/s with my 1 ghz cpu. DBS Excellent! How does this compare to NewBinary? ghc's Binary performs 4-6 mb/s in the same situations. if you are asking about features - see readme.txt, it

[Haskell-cafe] I/O and utf8

2006-01-08 Thread Andreas Kägi
hello i want to read a file encoded in utf8 and at a later time output portions of it on the console. Is there an easy way to do this in haskell? using the standard i/o functions i can read the file but the output gives me \1071 ... instead of the unicode characters.

[Haskell-cafe] Is there a notion for identity?

2006-01-08 Thread Tim Walkenhorst
{- Disclaimer: I'm rather new to Haskell and completely new to this board. I may not use the correct terminology in all cases, but I hope my intention becomes clear when you have a look at the code-snippets. -} Hey ho, Is there any way two find out whether two variables refer to the

Re: [Haskell-cafe] do {x-[1,2,3]; True - return (odd x); return x}.. why? (do notation, monads, guards)

2006-01-08 Thread Marc Weber
On Sun, Jan 08, 2006 at 12:19:40PM +0300, Bulat Ziganshin wrote: Hello Marc, Sunday, January 08, 2006, 3:19:56 AM, you wrote: MW list2=do { x - [1,2,3]; guard (odd x); return x} -- - provided by xerox list3 = [ x | x - [1,2,3], odd x] list4= take 2 $ [2*x+1,x-[0..]] ;-) Hi Bulat.. Thanks

Re: [Haskell-cafe] Is there a notion for identity?

2006-01-08 Thread Marc Weber
On Sun, Jan 08, 2006 at 12:43:31PM +0100, Tim Walkenhorst wrote: {- Disclaimer: I'm rather new to Haskell and completely new to this board. I may not use the correct terminology in all cases, but I hope my intention becomes clear when you have a look at the code-snippets. -} Hey

[Haskell-cafe] Avoiding name collisions by using value spaces instead of modules

2006-01-08 Thread Brian Hulley
Hi - A main problem I've found with Haskell is that within a module, too many things are put into the same scope. For example data Tree a b = Leaf a | Node {elem::b, lhs::Tree a b, rhs::Tree a b} puts Leaf, Node, elem, lhs, and rhs, into the module's namespace, as well as Tree. This means

Re: [Haskell-cafe] do {x-[1,2,3]; True - return (odd x); return x}.. why? (do notation, monads, guards)

2006-01-08 Thread Daniel Fischer
Am Sonntag, 8. Januar 2006 01:19 schrieb Marc Weber: Here is a simple program implementing the above function in 4 different ways.. See my comments to get to know where I have problems: -- begin test.hs -- module Main where import IO import Control.Monad.List {-

Re: [Haskell-cafe] Expanding do notation

2006-01-08 Thread Daniel Fischer
Am Samstag, 7. Januar 2006 23:56 schrieben Sie: Daniel, i also included you in crossposting because these letters can also help you understand how run-time compilation works. basically it's a very simple thing: when we can compute at compile time value of some computation, many compilers will

Re: [Haskell-cafe] Expanding do notation

2006-01-08 Thread Lennart Augustsson
Daniel Fischer wrote: Cool. So let's see if I got it. If I have n - readIO ... mapM_ (func n) list ... in my programme, the runtime system will/might build object code for func n that is then used instead of using the general code for func and supplying both arguments to that?

Re: [Haskell-cafe] Avoiding name collisions by using value spaces instead of modules

2006-01-08 Thread Daniel Fischer
Am Sonntag, 8. Januar 2006 14:06 schrieb Brian Hulley: Hi - A main problem I've found with Haskell is that within a module, too many things are put into the same scope. For example data Tree a b = Leaf a | Node {elem::b, lhs::Tree a b, rhs::Tree a b} puts Leaf, Node, elem, lhs, and rhs,

Re[7]: [Haskell-cafe] Project postmortem II /Haskell vs. Erlang/

2006-01-08 Thread Bulat Ziganshin
Hello Joel, Thursday, January 05, 2006, 2:01:43 PM, you wrote: JR Could you give us a bit more detail on this? forget about this :) i forget that direct i/o on sockets will block entire app. GHC organizez its own complex non-blocking machinery JR How does using handles involve large

Re[2]: [Haskell-cafe] x86 code generation going wrong?

2006-01-08 Thread Bulat Ziganshin
Hello Branimir, Sunday, January 08, 2006, 1:57:06 PM, you wrote: BM of appearance (note:OPTIONS didn't do anything I have to BM compile -O2 -fglasgow-exts explicitely, because I've got compile error for BM test3.hs ) use {-# OPTIONS_GHC -O2 -fglasgow-exts #-} -- Best regards, Bulat

Re[2]: [Haskell-cafe] Expanding do notation

2006-01-08 Thread Bulat Ziganshin
Hello Lennart, Sunday, January 08, 2006, 5:45:16 PM, you wrote: Cool. So let's see if I got it. If I have n - readIO ... mapM_ (func n) list ... in my programme, the runtime system will/might build object code for not object code itslef. haskell program in compiled form is

[Haskell-cafe] Re: fastest Binary library!

2006-01-08 Thread Joel Reymont
Thanks Bulat! I'm happy with Erlang for the time being but I'll consider your library for my next IO-intensive Haskell project. On Jan 7, 2006, at 6:08 PM, Bulat Ziganshin wrote: Joel, if you are interested in switchinh to my library - write me. i have ideas about supporting your 150 records

[Haskell-cafe] Where does memory go?

2006-01-08 Thread Joel Reymont
I compiled a simple one-liner: main = print Blah. This is the GC report: 5,620 bytes allocated in the heap 0 bytes copied during GC 0 collections in generation 0 ( 0.00s) 0 collections in generation 1 ( 0.00s) 1 Mb total memory in use Where did

Re: [Haskell-cafe] Where does memory go?

2006-01-08 Thread Duncan Coutts
On Sun, 2006-01-08 at 17:01 +, Joel Reymont wrote: I compiled a simple one-liner: main = print Blah. This is the GC report: 5,620 bytes allocated in the heap 0 bytes copied during GC 0 collections in generation 0 ( 0.00s) 0 collections in

Re: [Haskell-cafe] Avoiding name collisions by using value spaces instead of modules

2006-01-08 Thread Brian Hulley
- Original Message - From: Daniel Fischer [EMAIL PROTECTED] To: Brian Hulley [EMAIL PROTECTED] Cc: Haskell-cafe haskell-cafe@haskell.org Sent: Sunday, January 08, 2006 3:47 PM Subject: Re: [Haskell-cafe] Avoiding name collisions by using value spaces instead of modules Am Sonntag,

Re: [Haskell-cafe] Avoiding name collisions by using value spaces instead of modules

2006-01-08 Thread Cale Gibbard
On 08/01/06, Brian Hulley [EMAIL PROTECTED] wrote: For example, suppose I'm writing a module M that deals with grammar, where the elements in a grammar rule are parameterised so that rules can be written using strings but processed as if we'd used ints instead: data Element a = Terminal a

Re: [Haskell-cafe] Avoiding name collisions by using value spaces instead of modules

2006-01-08 Thread Brian Hulley
- Original Message - From: Cale Gibbard [EMAIL PROTECTED] To: Brian Hulley [EMAIL PROTECTED] Cc: Daniel Fischer [EMAIL PROTECTED]; Haskell-cafe haskell-cafe@haskell.org Sent: Sunday, January 08, 2006 5:54 PM Subject: Re: [Haskell-cafe] Avoiding name collisions by using value spaces

Re: [Haskell-cafe] Avoiding name collisions by using value spaces instead of modules

2006-01-08 Thread Cale Gibbard
On 08/01/06, Brian Hulley [EMAIL PROTECTED] wrote: - Original Message - From: Cale Gibbard [EMAIL PROTECTED] To: Brian Hulley [EMAIL PROTECTED] Cc: Daniel Fischer [EMAIL PROTECTED]; Haskell-cafe haskell-cafe@haskell.org Sent: Sunday, January 08, 2006 5:54 PM Subject: Re:

Re: [Haskell-cafe] x86 code generation going wrong?

2006-01-08 Thread Chris Kuklewicz
Brian Sniffen wrote: The first couldn't even complete on my 2.26 GHz Celeron! It's only got 512 MB of RAM, which may be part of the problem. I should not leak memory but it may be an optimization problem. Try explicitly using ghc -O2 -funbox-strict-fields. Stack space overflow: current

Re: [Haskell-cafe] Avoiding name collisions by using value spaces instead of modules

2006-01-08 Thread Brian Hulley
Cale Gibbard wrote: snip Thanks for the illustration - I see another advantage with type classes is that you only need to write the type signature once (in the class declaration) instead of before each instance binding. Secondly, if the functions are really different, and you never plan

Re: [Haskell-cafe] Is there a notion for identity?

2006-01-08 Thread Robert Dockins
On Sunday 08 January 2006 06:43 am, Tim Walkenhorst wrote: {- Disclaimer: I'm rather new to Haskell and completely new to this board. I may not use the correct terminology in all cases, but I hope my intention becomes clear when you have a look at the code-snippets. -} Hey ho, Is

Re: [Haskell-cafe] x86 code generation going wrong?

2006-01-08 Thread Branimir Maksimovic
From: Chris Kuklewicz [EMAIL PROTECTED] To: [EMAIL PROTECTED], Haskell Cafe haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] x86 code generation going wrong? Date: Sun, 08 Jan 2006 20:33:57 + Brian Sniffen wrote: The first couldn't even complete on my 2.26 GHz Celeron! It's only got

Re: [Haskell-cafe] x86 code generation going wrong?

2006-01-08 Thread Donald Bruce Stewart
bmaxa: From: Chris Kuklewicz [EMAIL PROTECTED] To: [EMAIL PROTECTED], Haskell Cafe haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] x86 code generation going wrong? Date: Sun, 08 Jan 2006 20:33:57 + Brian Sniffen wrote: The first couldn't even complete on my 2.26 GHz

Re: [Haskell-cafe] Avoiding name collisions by using value spaces instead of modules

2006-01-08 Thread Cale Gibbard
On 08/01/06, Brian Hulley [EMAIL PROTECTED] wrote: Cale Gibbard wrote: snip Thanks for the illustration - I see another advantage with type classes is that you only need to write the type signature once (in the class declaration) instead of before each instance binding. Secondly, if the

Re: [Haskell-cafe] Avoiding name collisions by using value spaces instead of modules

2006-01-08 Thread Cale Gibbard
Unifying these two under a single operation is certainly trickier, and it's a little more questionable that it should be done at all, given that their types are so different -- below is the closest I could come to it off-hand. --- {-# OPTIONS_GHC -fglasgow-exts #-} -- for

Re: [Haskell-cafe] x86 code generation going wrong?

2006-01-08 Thread Branimir Maksimovic
From: [EMAIL PROTECTED] (Donald Bruce Stewart) To: Branimir Maksimovic [EMAIL PROTECTED] CC: [EMAIL PROTECTED], [EMAIL PROTECTED],haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] x86 code generation going wrong? Date: Mon, 9 Jan 2006 11:15:51 +1100 bmaxa: From: Chris Kuklewicz

Re: [Haskell-cafe] Avoiding name collisions by using value spaces instead of modules

2006-01-08 Thread Brian Hulley
Cale Gibbard wrote: Unifying these two under a single operation is certainly trickier, and it's a little more questionable that it should be done at all, given that their types are so different -- below is the closest I could come to it off-hand. --- {-# OPTIONS_GHC -fglasgow-exts #-} -- for

[Haskell-cafe] In for a penny, in for a pound.

2006-01-08 Thread David F. Place
Hi All, Regarding the Fannkuch Shootout Entry: If we are willing to specialize flop in the way shown on the wiki, another 8% can be gained by similarly specializing rotate: rotate 2 (x1:x2:xs) = x2:x1:xs rotate 3 (x1:x2:x3:xs) = x2:x3:x1:xs rotate 4 (x1:x2:x3:x4:xs) = x2:x3:x4:x1:xs rotate

Re: [Haskell-cafe] In for a penny, in for a pound.

2006-01-08 Thread Donald Bruce Stewart
d: Regarding the Fannkuch Shootout Entry: If we are willing to specialize flop in the way shown on the wiki, another 8% can be gained by similarly specializing rotate: rotate 2 (x1:x2:xs) = x2:x1:xs rotate 3 (x1:x2:x3:xs) = x2:x3:x1:xs ... Cheers, I've updated the proposed entry on the

Re: [Haskell-cafe] Where does memory go?

2006-01-08 Thread Bulat Ziganshin
Hello Joel, Sunday, January 08, 2006, 8:01:00 PM, you wrote: JR I compiled a simple one-liner: main = print Blah. JR5,620 bytes allocated in the heap again, see at the GHC.Handle and so on :) try to find print definition and manually substitute all the code generated by this line. btw,