Re: [Haskell-cafe] Is there already an abstraction for this?

2008-09-23 Thread Jake Mcarthur
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The first thing I thought of was to try to apply one of the recursion schemes in the category-extras package. Here is what I managed using catamorphism. - - Jake -

[Haskell-cafe] ANN: A Functional Implementation of the Garsia-Wachs Algorithm

2008-09-23 Thread Nicolas Pouillard
Hi All, Here is an Haskell implementation of an algorithm that builds a binary tree with minimum weighted path length from weighted leaf nodes given in symmetric order. This can be used to build optimum search tables, to balance a 'ropes' data structure in an optimal way. This module a direct

Re: [Haskell-cafe] ANN: A Functional Implementation of the Garsia-Wachs Algorithm

2008-09-23 Thread Don Stewart
nicolas.pouillard: Hi All, Here is an Haskell implementation of an algorithm that builds a binary tree with minimum weighted path length from weighted leaf nodes given in symmetric order. This can be used to build optimum search tables, to balance a 'ropes' data structure in an

[Haskell-cafe] Re: [Haskell] Haskell Weekly News: Issue 86 - September 20, 2008

2008-09-23 Thread Wolfgang Jeltsch
Am Samstag, 20. September 2008 17:25 schrieb Brent Yorgey: […] darcs 2.0.3pre1. Eric Kow [3]announced the first pre-release of [4]darcs 2.0.3, featuring a few major bug fixes and a handful of interesting features. 3. 

Re: [Haskell-cafe] Is there already an abstraction for this?

2008-09-23 Thread Sebastiaan Visser
This (recent) paper describes a very interesting way to perform generic term rewriting: http://www.cs.uu.nl/research/techreps/repo/CS-2008/2008-020.pdf On Sep 23, 2008, at 3:46 AM, Jeremy Shaw wrote: Hello, I am trying to figure out if there is an existing abstraction I am missing here. I

Re: [Haskell-cafe] Re: [Haskell] Haskell Weekly News: Issue 86 - September 20, 2008

2008-09-23 Thread Wolfgang Jeltsch
Am Dienstag, 23. September 2008 09:35 schrieb Wolfgang Jeltsch: Am Samstag, 20. September 2008 17:25 schrieb Brent Yorgey: […] darcs 2.0.3pre1. Eric Kow [3]announced the first pre-release of [4]darcs 2.0.3, featuring a few major bug fixes and a handful of interesting features.

Re: [Haskell-cafe] Packages

2008-09-23 Thread Wolfgang Jeltsch
Am Sonntag, 21. September 2008 09:44 schrieb Andrew Coppin: […] 2. If we already have a Cabal package, why do we also need seperate packages for Arch, Gentoo, Debian...? Isn't Cabal cross-platform? If I want to install gtk2hs on Debian, I’d like gtk (the C library) to be automatically

Re[2]: [Haskell-cafe] Climbing up the shootout...

2008-09-23 Thread Bulat Ziganshin
Hello Manlio, Tuesday, September 23, 2008, 1:36:16 PM, you wrote: Any roadmap for improve support in intensive IO multiplexing? Or, at least, some papers about how this is implemented in GHC? Af far as I understand, select is used in two separate places. How much effort it takes to

Re[4]: [Haskell-cafe] Climbing up the shootout...

2008-09-23 Thread Bulat Ziganshin
Hello Sterling, Tuesday, September 23, 2008, 5:13:57 AM, you wrote: Oh, and it simply and naively loops with the following: while (fgets_unlocked (line, MAXLINELEN, stdin)) If Bulat's point is that the shootout has inspired work on Haskell performance, and in the stdlibs no less, then

Re: [Haskell-cafe] Climbing up the shootout...

2008-09-23 Thread Manlio Perillo
Don Stewart ha scritto: [...] Ok. So I'll just say: high level, efficient code is an overriding theme of many individuals working on Haskell. Things are better and better each year. We do not stand still. Any roadmap for improve support in intensive IO multiplexing? Or, at least, some papers

Re: [Haskell-cafe] how do i use quickcheck in the IO monad?

2008-09-23 Thread Michał Pałka
On Mon, 2008-09-22 at 12:35 -0700, Anatoly Yakovenko wrote: If i have functions in the IO monad, is there a way to use quickcheck to test them? I have a bunch of C bindings that unfortunately are not safe. But i would like to be able to use QuickCheck to test them. Hi Anatoly, If you want

Re: [Haskell-cafe] Climbing up the shootout...

2008-09-23 Thread Jules Bean
Bulat Ziganshin wrote: and this work obviously doesn't speed up every Haskell program. so that we have in Haskell world now is heroic efforts to speed up shootout test which doesn't say anything about real Haskell performance. what we have on prcatice is 10-20% speedup of ghc 6.8 and several

Re[2]: [Haskell-cafe] Climbing up the shootout...

2008-09-23 Thread Bulat Ziganshin
Hello Jules, Tuesday, September 23, 2008, 2:21:34 PM, you wrote: performance. what we have on prcatice is 10-20% speedup of ghc 6.8 and several libs which may improve speed in some usages If you understand performance as well as you claim to - and from your previous postings, I believe you

Re: [Haskell-cafe] Packages

2008-09-23 Thread Cetin Sert
Austin: Of course, if you are doing haskell development, the best possible way to go (IMO) full-blown cabal install since you will always get the most up-to-date code Let's say I go and compile a library from sources and install it through Cabal. How can I update the binary version of the

Re: [Haskell-cafe] Packages

2008-09-23 Thread Austin Seipp
Excerpts from Cetin Sert's message of Tue Sep 23 05:55:21 -0500 2008: Let's say I go and compile a library from sources and install it through Cabal. How can I update the binary version of the library Cabal installed after recompiling the library using newer/modified sources? I'm not quite

Re: [Haskell-cafe] Packages

2008-09-23 Thread Dougal Stanton
2008/9/23 Cetin Sert [EMAIL PROTECTED]: Austin: Let's say I go and compile a library from sources and install it through Cabal. How can I update the binary version of the library Cabal installed after recompiling the library using newer/modified sources? That should happen automatically

Re: [Haskell-cafe] Packages

2008-09-23 Thread Austin Seipp
Excerpts from Dougal Stanton's message of Tue Sep 23 06:09:58 -0500 2008: That should happen automatically with cabal-install if the version number in the .cabal file has changed. There doesn't seem to be a good way of forcing cabal-install to recreate a build (eg, if you want to

Re: [Haskell-cafe] Climbing up the shootout...

2008-09-23 Thread Manlio Perillo
Bulat Ziganshin ha scritto: Hello Manlio, Tuesday, September 23, 2008, 1:36:16 PM, you wrote: Any roadmap for improve support in intensive IO multiplexing? Or, at least, some papers about how this is implemented in GHC? Af far as I understand, select is used in two separate places. How

Re: [Haskell-cafe] Re: XML (HXML) parsing :: GHC 6.8.3 space leak from 2000

2008-09-23 Thread Marc A. Ziegert
-- Lazily build a tree out of a sequence of tree-building events build :: [TreeEvent] - ([UnconsumedEvent], [Tree String]) build (Start str : es) = let (es', subnodes) = build es (spill, siblings) = build es' in (spill, (Tree str

Re[2]: [Haskell-cafe] Climbing up the shootout...

2008-09-23 Thread Bulat Ziganshin
Hello Manlio, Tuesday, September 23, 2008, 3:14:58 PM, you wrote: Maybe improve GHC to make Haskell suitable to write high reliable internet servers is not of interest? well if it's interesting - do it :) various people do that they find most exciting/important. actually, alt-network package

[Haskell-cafe] piping to system call

2008-09-23 Thread Janis Voigtlaender
Hi, assume I have a program taking input from stdin. How do I call it from Haskell while feeding to it a string as input. That is, I want a function like system' :: String - String - IO ExitCode such that system' cmd inp would be equivalent to first writing inp to a file, say temp, and

Re: [Haskell-cafe] Climbing up the shootout...

2008-09-23 Thread Manlio Perillo
Bulat Ziganshin ha scritto: Hello Manlio, Tuesday, September 23, 2008, 3:14:58 PM, you wrote: Maybe improve GHC to make Haskell suitable to write high reliable internet servers is not of interest? well if it's interesting - do it :) Unfortunately, I no more have the time for do it your

Re[2]: [Haskell-cafe] Climbing up the shootout...

2008-09-23 Thread Bulat Ziganshin
Hello Manlio, Tuesday, September 23, 2008, 3:43:03 PM, you wrote: Maybe improve GHC to make Haskell suitable to write high reliable internet servers is not of interest? well if it's interesting - do it :) Unfortunately, I no more have the time for do it your self, unless there is

Re: [Haskell-cafe] piping to system call

2008-09-23 Thread Marc Weber
On Tue, Sep 23, 2008 at 01:37:56PM +0200, Janis Voigtlaender wrote: Hi, assume I have a program taking input from stdin. How do I call it from Haskell while feeding to it a string as input. Sure, have a look at

Re: [Haskell-cafe] piping to system call

2008-09-23 Thread Janis Voigtlaender
Marc Weber wrote: On Tue, Sep 23, 2008 at 01:37:56PM +0200, Janis Voigtlaender wrote: Hi, assume I have a program taking input from stdin. How do I call it from Haskell while feeding to it a string as input. Sure, have a look at

Re: [Haskell-cafe] ANN: A Functional Implementation of the Garsia-Wachs Algorithm

2008-09-23 Thread Ross Paterson
On Mon, Sep 22, 2008 at 11:15:36PM -0700, Nicolas Pouillard wrote: Here is an Haskell implementation of an algorithm that builds a binary tree with minimum weighted path length from weighted leaf nodes given in symmetric order. This can be used to build optimum search tables, to balance a

Re: Re[4]: [Haskell-cafe] Climbing up the shootout...

2008-09-23 Thread John Van Enk
amount of work required to do this is much much more than amount of work required to write optimal C/asm code I'm sorry, but no it's not. I've been using Haskell for a little under two years now, and I'm already able to produce programs with significantly less pain which outperform the C

[Haskell-cafe] Re: Is there already an abstraction for this?

2008-09-23 Thread Christian Maeder
Jeremy Shaw wrote: I have an expression data-type: data Expr = Quotient Expr Expr | Product Expr Expr | Sum Expr Expr | Difference Expr Expr | Lit Double | Var Char deriving (Eq, Ord, Data, Typeable, Read, Show) I prefer such expressions written as: data BinOp

Re: [Haskell-cafe] piping to system call

2008-09-23 Thread Jules Bean
Marc Weber wrote: On Tue, Sep 23, 2008 at 01:37:56PM +0200, Janis Voigtlaender wrote: Hi, assume I have a program taking input from stdin. How do I call it from Haskell while feeding to it a string as input. Sure, have a look at

Re: [Haskell-cafe] Packages

2008-09-23 Thread Cetin Sert
Does that answer your query? Yep it does, ^__^ Thank you very much. Cetin 2008/9/23 Austin Seipp [EMAIL PROTECTED] Excerpts from Dougal Stanton's message of Tue Sep 23 06:09:58 -0500 2008: That should happen automatically with cabal-install if the version number in the .cabal file has

Re: [Haskell-cafe] piping to system call

2008-09-23 Thread Janis Voigtlaender
Jules Bean wrote: Marc Weber wrote: On Tue, Sep 23, 2008 at 01:37:56PM +0200, Janis Voigtlaender wrote: Hi, assume I have a program taking input from stdin. How do I call it from Haskell while feeding to it a string as input. Sure, have a look at

Re[6]: [Haskell-cafe] Climbing up the shootout...

2008-09-23 Thread Bulat Ziganshin
Hello John, Tuesday, September 23, 2008, 4:27:05 PM, you wrote: amount of work required to do this is much much more than amount of work required to write optimal C/asm code I'm sorry, but no it's not. I've been using Haskell for a little under two years now, and I'm already able to

Re: [Haskell-cafe] piping to system call

2008-09-23 Thread Jules Bean
Janis Voigtlaender wrote: Jules Bean wrote: Marc Weber wrote: On Tue, Sep 23, 2008 at 01:37:56PM +0200, Janis Voigtlaender wrote: Hi, assume I have a program taking input from stdin. How do I call it from Haskell while feeding to it a string as input. Sure, have a look at

Re: Re[6]: [Haskell-cafe] Climbing up the shootout...

2008-09-23 Thread John Van Enk
Probably not, but I think you completely missed my point. Perhaps I should have originally written my original C equivalents rather than the. You're probably just a better C programmer than me. On Tue, Sep 23, 2008 at 9:25 AM, Bulat Ziganshin [EMAIL PROTECTED]wrote: Hello John, Tuesday,

Re[8]: [Haskell-cafe] Climbing up the shootout...

2008-09-23 Thread Bulat Ziganshin
Hello John, Tuesday, September 23, 2008, 5:39:17 PM, you wrote: Probably not, but I think you completely missed my point. Perhaps I should have originally written my original C equivalents rather than the. You're probably just a better C programmer than me. well, i don't say about me

[Haskell-cafe] Re: hGetContents and lazyness

2008-09-23 Thread Max Vasin
Micah Cowan [EMAIL PROTECTED] writes: Max Vasin wrote: Hello, haskellers! Suppose we have function (it filters package filenames from apt Packages file): getPackageList :: FilePath - IO [FilePath] getPackageList packageFile = withFile packageFile ReadMode $

Re: [Haskell-cafe] how do i use quickcheck in the IO monad?

2008-09-23 Thread Bas van Dijk
On Mon, Sep 22, 2008 at 9:35 PM, Anatoly Yakovenko [EMAIL PROTECTED] wrote: If i have functions in the IO monad, is there a way to use quickcheck to test them? Maybe you can use Test.QuickCheck.Monadic in QuickCheck 2.1. I never used it so I can't explain how it works. However there are some

Re: [Haskell-cafe] piping to system call

2008-09-23 Thread Marco Túlio Gontijo e Silva
Em Ter, 2008-09-23 às 13:37 +0200, Janis Voigtlaender escreveu: (...) That is, I want a function like system' :: String - String - IO ExitCode such that system' cmd inp would be equivalent to first writing inp to a file, say temp, and then calling system (cmd ++ temp)

Re: [Haskell-cafe] Re: XML (HXML) parsing :: fixed GHC 6.8.3 space leak from 2000

2008-09-23 Thread Lev Walkin
This solution seem to provide a practical alternative to pusing datatypes for streaming XML. http://gemo.futurs.inria.fr/events/PLANX2008/papers/p10.pdf Lev Walkin wrote: Marc A. Ziegert wrote: We don't know of a good way to fix this problem. I'm going to record this example in a ticket

Re[10]: [Haskell-cafe] Climbing up the shootout...

2008-09-23 Thread Bulat Ziganshin
Hello Donnie, Tuesday, September 23, 2008, 7:16:04 PM, you wrote: I don't understand why you are willing to criticize GHC, but unwilling to help improve GHC.  Personally, I think it is a waste of everyone's time for you to just complain about GHC without offering suggestions on how to

Re: [Haskell-cafe] piping to system call

2008-09-23 Thread Brandon S. Allbery KF8NH
On 2008 Sep 23, at 7:55, Marc Weber wrote: On Tue, Sep 23, 2008 at 01:37:56PM +0200, Janis Voigtlaender wrote: assume I have a program taking input from stdin. How do I call it from Haskell while feeding to it a string as input. Sure, have a look at

Re: [Haskell-cafe] Re: hGetContents and lazyness

2008-09-23 Thread Micah Cowan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Max Vasin wrote: Micah Cowan [EMAIL PROTECTED] writes: I think we'd need to see the actual input and expected output, to understand what's going wrong here. It worked fine for me, for small tests. The gzipped example file is here:

Re: Re[8]: [Haskell-cafe] Climbing up the shootout...

2008-09-23 Thread Sebastian Sylvan
On Tue, Sep 23, 2008 at 2:52 PM, Bulat Ziganshin [EMAIL PROTECTED]wrote: Hello John, Tuesday, September 23, 2008, 5:39:17 PM, you wrote: Probably not, but I think you completely missed my point. Perhaps I should have originally written my original C equivalents rather than the. You're

[Haskell-cafe] Re: ANNOUNCE: protocol-buffers-0.2.9 for Haskell is ready

2008-09-23 Thread Simon Marlow
Chris Kuklewicz wrote: I am cross-posting this message to several lists. I had learned the trick before the documentation was updated. It seems I have used a very unreliable trick. And the use castToSTUArray suggested alternative is a really poor one since I am not using arrays at all.

Re: [Haskell-cafe] ANN: A Functional Implementation of the Garsia-Wachs Algorithm

2008-09-23 Thread Nicolas Pouillard
I've just released an 1.2 version. Excerpts from Ross Paterson's message of Tue Sep 23 05:03:29 -0700 2008: On Mon, Sep 22, 2008 at 11:15:36PM -0700, Nicolas Pouillard wrote: Here is an Haskell implementation of an algorithm that builds a binary tree with minimum weighted path length from

[Haskell-cafe] Building DLLs

2008-09-23 Thread Andrew Coppin
OK, so a GHC question: Apparently at some point, GHC used to support DLLs. And then it stopped working. And then it may or may not have been brought back again... Does anybody know exactly what the status of this is? Is it currently working or broken? If it's working, what can and can't you

Re: [Haskell-cafe] Line noise

2008-09-23 Thread wren ng thornton
Brian Hurt wrote: On Sun, 21 Sep 2008, wren ng thornton wrote: Even with functionalists ---of the OCaml and SML ilk--- this use of spaces can be confusing if noone explains that function application binds tighter than all operators. Bwuh? Ocaml programmers certainly know that

Re: [Haskell-cafe] Re: Climbing up the shootout...

2008-09-23 Thread wren ng thornton
ChrisK wrote: And, though I had never seen it before, the current winner for speed is ATS ( http://www.ats-lang.org/ ) which is dependently-typed functional language. And as discussed on Reddit recently[1] it uses a good deal of embedded C/C++ and so is subject to the same non-idiomatic

Re: [Haskell-cafe] Is there already an abstraction for this?

2008-09-23 Thread wren ng thornton
Jeremy Shaw wrote: -- |Deep map of an expression. eMap :: (Expr - Expr) - Expr - Expr eMap f (Sum a b) = f (Sum (eMap f a) (eMap f b)) eMap f (Difference a b) = f (Difference (eMap f a) (eMap f b)) eMap f (Product a b) = f (Product (eMap f a) (eMap f b)) eMap f (Quotient a b) = f (Quotient (eMap

Re: [Haskell-cafe] what is the magic hash?

2008-09-23 Thread wren ng thornton
Jason Dusek wrote: Derek Elkins [EMAIL PROTECTED] wrote: Jason Dusek wrote: It is not much covered in the docs. It has something to do with magic triggered by a postfix octothorpe? All it does is allow them in identifiers. That's it? So it's for use in conjunction with primitive

Re: [Haskell-cafe] Line noise

2008-09-23 Thread Brandon S. Allbery KF8NH
On 2008 Sep 21, at 15:10, Andrew Coppin wrote: Philippa Cowderoy wrote: On Sun, 21 Sep 2008, Andrew Coppin wrote: - Several standard library functions have names which clash badly with the usual meanings of those names - e.g., break, return, id. For this one, I'm inclined to say welcome to

[Haskell-cafe] A question about parsec implementation

2008-09-23 Thread Xinyu Jiang
Hi everybody, I am trying to port (a part of) the parsec library to scheme. I have read the paper and the haskell source of parsec, but I still have a problem. May be the problem is from my lack of parser knowledge, but I have to bother you. Scheme does not support lazy evaluation by default,

Re: [Haskell-cafe] Re: [m..n] question

2008-09-23 Thread Brandon S. Allbery KF8NH
On 2008 Sep 22, at 5:46, Jon Fairbairn wrote: Richard A. O'Keefe [EMAIL PROTECTED] writes: It is being claimed that the reason for this is that exceptions are problematic in Hasell, so the Haskell designers went out of their way to make this function total whether it made sense or not. I'm

Re: [Haskell-cafe] Is there already an abstraction for this?

2008-09-23 Thread ajb
G'day. Quoting Jeremy Shaw [EMAIL PROTECTED]: I have an expression data-type: data Expr = Quotient Expr Expr | Product Expr Expr | Sum Expr Expr | Difference Expr Expr | Lit Double | Var Char deriving (Eq, Ord, Data, Typeable, Read, Show) And I want to write a