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,