Re: [Haskell-cafe] ANN: powerpc-0.0.1

2010-03-10 Thread Tom Hawkins
On Wed, Mar 10, 2010 at 8:07 AM, Warren Henning warren.henn...@gmail.com wrote: Wow. Quite ambitious. Was this inspired by work at your current employer like with Atom and some of the other stuff you've released? Yes, we had an immediate need to debug some machine code. I looked around, but

Re: [Haskell-cafe] Re: more thoughts on Finally tagless

2010-03-10 Thread Bruno Oliveira
Hi Oleg, (cc'ed the haskell-cafe as it may be of interest to other readers) On Tue, 9 Mar 2010 o...@okmij.org wrote: Hi, Bruno! Of course I know the EMGM paper and approach -- we discuss it at great length in the paper we are both editing, don't we? What I had in mind about tagless

[Haskell-cafe] PseudoTerminals and Handles (again)

2010-03-10 Thread Mathijs Kwik
Hi All, A few days ago, I got started with the code found on this blogpost: http://www.serpentine.com/blog/2008/09/30/unix-hacking-in-haskell-better-pseudoterminal-support On my system, I found that using pseudoterminals as handles did not work. Reading output and writing input works fine, it's

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-10 Thread Tillmann Rendel
Martijn van Steenbergen wrote: Tom Schrijvers wrote: data EvalDict sem = EvalDict { val :: Int - sem Int, add :: sem Int - sem Int - sem Int } An alternative option is to capture the structure in a GADT: data Eval a where Val :: Int - Eval Int Add :: Eval Int - Eval Int - Eval Int And

Re: [Haskell-cafe] First time haskell - parse error!

2010-03-10 Thread Sebastian Fischer
On Mar 10, 2010, at 8:47 AM, Ketil Malde wrote: I think it is better style to avoid this kind of one-off named values. I much prefer: then Golds ++show (gold s g)++... For some reason, this is a style isse that doesn't get much attention At the end of the Section on function

Re: [Haskell-cafe] First time haskell - parse error!

2010-03-10 Thread Miguel Mitrofanov
Maybe it's just me, but I think composition chain is MUCH easier to read. When readning, I'd probably transform the last version to the previous one by hand, just to make it more comprehensible. Sebastian Fischer wrote: On Mar 10, 2010, at 8:47 AM, Ketil Malde wrote: I think it is better

Re: [Haskell-cafe] 3rd party widgets with qtHaskell (Marble)

2010-03-10 Thread Alp Mestanogullari
This something you are afaik able to do. I'm cc'ing David (qthaskell's author). On Wed, Mar 10, 2010 at 1:59 AM, Philip Beadling phil.beadl...@googlemail.com wrote: Hi, I know this isn't a qtHaskell list, but I don't think there is one. Was wondering if anyone has any ideas on the below.

[Haskell-cafe] Re: First time haskell - parse error!

2010-03-10 Thread John Lato
From: Ketil Malde ke...@malde.org S. Doaitse Swierstra doai...@cs.uu.nl writes:      then (s1 ++ s2 ++ s3 ++ s4) where              s1 = Golds              s2 = show (gold s g)              s3 = , Silvers              s4 = show (silver s g) If you want to keep the definitions local to

Re: [Haskell-cafe] Num instance for Lazy ByteStrings (was: NumLazyByteString Package License)

2010-03-10 Thread Henning Thielemann
Yitzchak Gale schrieb: Henning Thielemann wrote: Is NumLazyByteString a newtype around Bytestring.Lazy that interprets the bit stream represented by the ByteString as integer? Thomas DuBuisson wrote: Not exactly. There is not newtype wrapper. NumLazyByteString is: instance Num

[Haskell-cafe] Re: If the local variable can be changed ...

2010-03-10 Thread John Lato
From: zaxis z_a...@163.com So if the local variable can be changed, then we can use loop, etc. same as imperative languages. For example, for (i=0; i100; i++)  where `i` is a local variable in function. In addition to John Millikin's suggestion, you can also do: map f [0..99] where f ::

Re: [Haskell-cafe] First time haskell - parse error!

2010-03-10 Thread Ketil Malde
Miguel Mitrofanov miguelim...@yandex.ru writes: Maybe it's just me, but I think composition chain is MUCH easier to read. I definitely agree. [Cited from Learn You a Haskell for Great Good] oddSquareSum :: Integer oddSquareSum = sum . takeWhile (1) . filter odd . map (^2) $

Re: [Haskell-cafe] First time haskell - parse error!

2010-03-10 Thread Colin Adams
On 10 March 2010 11:21, Ketil Malde ke...@malde.org wrote: [Cited from Learn You a Haskell for Great Good]     oddSquareSum :: Integer     oddSquareSum = sum . takeWhile (1) . filter odd . map (^2) $ [1..] To me, the first one is very clear, and exposes the function as what it is: a

Naming and coding style (was: [Haskell-cafe] First time haskell - parse error!)

2010-03-10 Thread Ketil Malde
Colin Adams colinpaulad...@googlemail.com writes: Named values are just like comments, which IMO also should be kept to a bare minimum.  A bit tongue in cheek: If you need a name to understand what a function does, or a comment to understand how it does it, then your code is too complicated.

[Haskell-cafe] Detecting extensions of the host processor

2010-03-10 Thread Henning Thielemann
I like to detect at runtime whether the processor my program runs on has certain extensions (SSE2, SSE3 or so) in order to execute optimized code. On Linux I can process the contents of /proc/cpuinfo but this will not work on Windows. Is there a portable way in Haskell?

Re: [Haskell-cafe] First time haskell - parse error!

2010-03-10 Thread Sebastian Fischer
On Mar 10, 2010, at 12:21 PM, Ketil Malde wrote: Introducing names means that I need to keep the temporary definitions in my head, and I think takeWhile (1) is as clear as it can get. And while a name can be misleading (belowLimit is a boolean, no?) or flat out wrong, the definition has

Re: [Haskell-cafe] Detecting extensions of the host processor

2010-03-10 Thread Evgeny Tarasov
If you use intel processor, you should call 'cpuid' assembler instruction to obtain this info. Look at this document for the instruction semantics: http://www.intel.com/Assets/PDF/manual/253666.pdf There is a wrapper for cpuid in haskell: http://hackage.haskell.org/package/cpuid Henning

Re: Naming and coding style (was: [Haskell-cafe] First time haskell - parse error!)

2010-03-10 Thread Daniel Fischer
Am Mittwoch 10 März 2010 13:03:59 schrieb Ketil Malde: never introduce names if it increases the size of your program.  (Corrolary: don't name things that aren't referred to at least twice) Objection! If the final result of your function is a combination of a handful or two of long (and

Re: [Haskell-cafe] First time haskell - parse error!

2010-03-10 Thread Stephen Tetley
Hello all Algorithmically oddSquareSum is a bit below par though... oddSquareSum :: Integer oddSquareSum = sum . takeWhile (1) . filter odd . map (^2) $ [1..] Why filter out the evens after generating them? oos1 :: Integer oss1 = sum . takeWhile (1) $ map (^2) odds where odds

Re: [Haskell-cafe] First time haskell - parse error!

2010-03-10 Thread Max Rabkin
On Wed, Mar 10, 2010 at 3:53 PM, Stephen Tetley stephen.tet...@gmail.com wrote:   where odds = iterate (+2) 1 Or odds = [1,3..] --Max ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] First time haskell - parse error!

2010-03-10 Thread Stephen Tetley
Hi Max Nice! - I didn't know about that syntax. PS I should have said Why generate the evens only to filter them out? On 10 March 2010 13:57, Max Rabkin max.rab...@gmail.com wrote: [Snip] Or odds = [1,3..] ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] First time haskell - parse error!

2010-03-10 Thread Ketil Malde
Sebastian Fischer s...@informatik.uni-kiel.de writes: I do not agree that introducing names locally for compositions is *always* a bad idea, even if used only once. Well, of course I do that all the time too. :-) (Choosing names that are misleading or flat out wrong is of course always a

Re: [Haskell-cafe] First time haskell - parse error!

2010-03-10 Thread Daniel Fischer
Am Mittwoch 10 März 2010 14:53:32 schrieb Stephen Tetley: Hello all Algorithmically oddSquareSum is a bit below par though... oddSquareSum :: Integer oddSquareSum = sum . takeWhile (1) . filter odd . map (^2) $ [1..] Why filter out the evens after generating them? oos1 ::

Re: [Haskell-cafe] First time haskell - parse error!

2010-03-10 Thread Ketil Malde
Stephen Tetley stephen.tet...@gmail.com writes: oddSquareSum :: Integer oddSquareSum = sum . takeWhile (1) . filter odd . map (^2) $ [1..] Why filter out the evens after generating them? In other words: sum . takeWhile (1) . filter odd . map (^2) $ [1..] Since odd (x^2) = odd x:

[Haskell-cafe] Re: Anyone up for Google SoC 2010?

2010-03-10 Thread Yakov Zaytsev
I've got N900 recently and saw that according to this page http://hackage.haskell.org/trac/ghc/wiki/Platforms it's not possible to run GHC and GHCi easily on ARM. This sucks. I want to propose a project bring GHC back to life on arm-linux. It is supposed that the outcome will be a package for

[Haskell-cafe] Re: First time haskell - parse error!

2010-03-10 Thread Maciej Piechotka
Good names can help making comments less important. OTOH, comment can give you the best(?) of both worlds, both revealing the linear structure of the function, while still providing extra information: oddSquareSum :: Integer oddSquareSum = sum -- add together

[Haskell-cafe] Re: Anyone up for Google SoC 2010?

2010-03-10 Thread Gour
On Wed, 10 Mar 2010 17:43:06 -0500 Yakov == Yakov Zaytsev ya...@yakov.cc wrote: Yakov I want to propose a project bring GHC back to life on Yakov arm-linux. It is supposed that the outcome will be a package Yakov for Maemo 5. I hope we'll have MeeGo by the end of GSOC. ;) Go, for it!

[Haskell-cafe] Re: ANNOUNCE: yesod 0.0.0 (web framework)

2010-03-10 Thread Gour
On Sun, 7 Mar 2010 21:03:12 -0800 Michael == Michael Snoyman mich...@snoyman.com wrote: Michael * Deployable anywhere (based on WAI) Does it mean one will be able to use it with webservers like Cherokee, nginx...? Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6

[Haskell-cafe] Re: Naming and coding style (was: First time haskell - parse error!)

2010-03-10 Thread Maciej Piechotka
On Wed, 2010-03-10 at 13:03 +0100, Ketil Malde wrote: Colin Adams colinpaulad...@googlemail.com writes: Named values are just like comments, which IMO also should be kept to a bare minimum. A bit tongue in cheek: If you need a name to understand what a function does, or a comment to

Re: [Haskell-cafe] Re: ANNOUNCE: yesod 0.0.0 (web framework)

2010-03-10 Thread Michael Snoyman
On Wed, Mar 10, 2010 at 7:10 AM, Gour g...@gour-nitai.com wrote: On Sun, 7 Mar 2010 21:03:12 -0800 Michael == Michael Snoyman mich...@snoyman.com wrote: Michael * Deployable anywhere (based on WAI) Does it mean one will be able to use it with webservers like Cherokee, nginx...? Right

[Haskell-cafe] Re: ANNOUNCE: yesod 0.0.0 (web framework)

2010-03-10 Thread Gour
On Wed, 10 Mar 2010 07:24:15 -0800 Michael == Michael Snoyman mich...@snoyman.com wrote: Michael Right now, the only WAI backends I'm aware of are the two I've Michael written: SimpleServer and CGI. Assuming Cherokee and nginx Michael support CGI, then yes, you could deploy there. I'm more

[Haskell-cafe] Re: If the local variable can be changed ...

2010-03-10 Thread Stefan Monnier
So if the local variable can be changed, then we can use loop, etc. same as imperative languages. For example, for (i=0; i100; i++) where `i` is a local variable in function. It is true that a pure language could support such things (some pure languages do, e.g. Sisal). The experience of

Re: [Haskell-cafe] vector stream fusion, inlining and compilation time

2010-03-10 Thread Jake McArthur
Here's a transcript from a conversation I had with Conal on IRC. tl;dr: conal cross-module inlining is only possible because ghc stashes a definition in a .hi, iuuc. i'm suggesting that the stashed definition either (a) never include further inlinings, or (b) be augmented by such a definition.

Re: [Haskell-cafe] vector stream fusion, inlining and compilation time

2010-03-10 Thread Max Bolingbroke
This is my understanding: Old story (GHC 6.12.1 (?) and below): 1) Function bodies are only optimised if they are not marked INLINE. The assumption is that INLINE bodies will be inlined and then optimised at the point where they are inlined. 2) Unfoldings are exported in .hi files for functions

[Haskell-cafe] Upgrading to Haskell Platform

2010-03-10 Thread David Place
Hi: I am running GHC 6.10.4 on Mac OSX 10.6.2. Somehow, I have a broken version of Cabal (1.6.0.3) installed. In order to fix it, I thought I should just upgrade to the Haskell Platform. Is it necessary to uninstall my current GHC first? If, so, how? Thanks you. Cheers, David

Re: [Haskell-cafe] First time haskell - parse error!

2010-03-10 Thread Tillmann Rendel
Ketil Malde wrote: Also, good names are harder than they sound: I don't think 'belowLimit' is a good name for 'takeWhile (1)', for instance. I certainly couldn't guess what it was for without looking at the implementation, which kind of defeats the purpose of names for improving code

Re: [Haskell-cafe] Anyone up for Google SoC 2010?

2010-03-10 Thread Johan Tibell
What's the status on this? Have we applied as organization? Do we have enough mentors? Cheers, Johan On Mon, Feb 1, 2010 at 4:02 PM, Edward Kmett ekm...@gmail.com wrote: I would happily participate as a mentor again and I am willing to step up as administrator if you want to get it off your

Re: [Haskell-cafe] Re: ANNOUNCE: yesod 0.0.0 (web framework)

2010-03-10 Thread Michael Snoyman
On Wed, Mar 10, 2010 at 8:00 AM, Gour g...@gour-nitai.com wrote: [...] Michael That said, I intend to port hack-handler-fastcgi to WAI in the Michael not-too-distant future. If anyone needs it sooner, just send Michael me an e-mail, it will probably take very little time to port Michael

[Haskell-cafe] Re: ANNOUNCE: yesod 0.0.0 (web framework)

2010-03-10 Thread Gour
On Wed, 10 Mar 2010 09:18:02 -0800 Michael == Michael Snoyman mich...@snoyman.com wrote: Michael During the planning of WAI, they mentioned that Happstack Michael uses the sendfile system call for optimizing sending of Michael static files. WAI includes support for this now (look at the Michael

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-10 Thread Tillmann Rendel
Tom Schrijvers wrote: William Cook's Onward! essay is relevant here. He characterizes the difference between objects and abstract data types nicely: the latter allow binary methods that pattern match (to exploit the combined knowledge of the internals of two different values) whereas objects

Re: [Haskell-cafe] Re: ANNOUNCE: yesod 0.0.0 (web framework)

2010-03-10 Thread Michael Snoyman
On Wed, Mar 10, 2010 at 10:11 AM, Gour g...@gour-nitai.com wrote: [..] Michael I also wouldn't have a use for mod_haskell, but it seems Michael every cool kid on the block has it ;). How do you like other players (Cherokee, nginx,...)? Frankly, I haven't used either of those (though I

Re: [Haskell-cafe] Haskell course, training

2010-03-10 Thread Matthias Görgens
I think I've reached the point where I need some tutoring, so provided I've got money for travel and course fees, and time, where do I get it? I'm not a student so some courses aren't available to me. How about visiting our Haskell meeting in Leipzig, June 4th? Which I can only recommend!

[Haskell-cafe] Space leak

2010-03-10 Thread Arnoldo Muller
Hello, I am learning haskell and I found a space leak that I find difficult to solve. I've been asking at #haskell but we could not solve the issue. I want to lazily read a set of 22 files of about 200MB each, filter them and then I want to output the result into a unique file. If I modify the

Re: [Haskell-cafe] Space leak

2010-03-10 Thread Bulat Ziganshin
Hello Arnoldo, Wednesday, March 10, 2010, 11:45:56 PM, you wrote: I am learning haskell and I found a space leak that I find difficult to solve. I've been asking at #haskell but we could not solve the issue. make some experiments - leave only one file and use version A, then replace

[Haskell-cafe] definition of sum

2010-03-10 Thread TeXitoi
After programming as an exercice the sum function, my version is faster than the Data.List's version. Looking at the source code, Data.List uses a foldl and not a foldl'. foldl' seems faster and allows to use very big lists. So, why is foldl used by Data.List for sum? -- Guillaume Pinot

Re: [Haskell-cafe] Space leak

2010-03-10 Thread Daniel Fischer
Am Mittwoch 10 März 2010 21:45:56 schrieb Arnoldo Muller: Hello, I am learning haskell and I found a space leak that I find difficult to solve. I've been asking at #haskell but we could not solve the issue. I want to lazily read a set of 22 files of about 200MB each, filter them and then I

Re: [Haskell-cafe] definition of sum

2010-03-10 Thread Don Stewart
texitoi: After programming as an exercice the sum function, my version is faster than the Data.List's version. Looking at the source code, Data.List uses a foldl and not a foldl'. foldl' seems faster and allows to use very big lists. So, why is foldl used by Data.List for sum? It's

Re: [Haskell-cafe] definition of sum

2010-03-10 Thread Daniel Fischer
Am Mittwoch 10 März 2010 22:33:43 schrieb TeXitoi: After programming as an exercice the sum function, my version is faster than the Data.List's version. Looking at the source code, Data.List uses a foldl and not a foldl'. foldl' seems faster and allows to use very big lists. So, why is foldl

Re: [Haskell-cafe] Space leak

2010-03-10 Thread Arnoldo Muller
Hello Daniel: Thanks! I employed mapM'_ but I am still getting the space leak. Any other hint? Arnoldo On Wed, Mar 10, 2010 at 10:40 PM, Daniel Fischer daniel.is.fisc...@web.dewrote: Am Mittwoch 10 März 2010 21:45:56 schrieb Arnoldo Muller: Hello, I am learning haskell and I found a

Re: [Haskell-cafe] Space leak

2010-03-10 Thread Arnoldo Muller
Hello Bulat, I ran program A with writeFile instead of appendFile and it still works without problems. Regarding program B, if I use writeFile the leaking still occurs. Any other hints? :) Arnoldo On Wed, Mar 10, 2010 at 10:32 PM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello

Re: [Haskell-cafe] Space leak

2010-03-10 Thread Arnoldo Muller
Hello Justin, I tried and what I saw was a constant increase in memory usage. Any particular profiling option that you would use? I do remember that there was a particular option in which the leak would dissapear (for the same amount of work) and that is why I stopped using the profiler.

[Haskell-cafe] Problem installing wxHaskell on Haskell Platform on OSX.

2010-03-10 Thread David Place
Hi: I have just installed the Haskell Platform 2009.2.0.2 on Mac OSX 10.6.2. When I try to install wx I get the following error which I do not understand. Can anyone give me a hint? $ cabal install wx Resolving dependencies... cabal: cannot configure containers-0.3.0.0. It requires base =4.2

Re: [Haskell-cafe] Space leak

2010-03-10 Thread Bulat Ziganshin
Hello Arnoldo, Wednesday, March 10, 2010, 11:45:56 PM, you wrote: I am learning haskell and I found a space leak that I find difficult to solve. I've been asking at #haskell but we could not solve the issue. what if you use program B on single file? -- Best regards, Bulat

Re: [Haskell-cafe] Space leak

2010-03-10 Thread Arnoldo Muller
Bulat, The same happens, the memory starts to quickly fill up... Arnoldo On Wed, Mar 10, 2010 at 11:16 PM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Arnoldo, Wednesday, March 10, 2010, 11:45:56 PM, you wrote: I am learning haskell and I found a space leak that I find

Re: [Haskell-cafe] Problem installing wxHaskell on Haskell Platform on OSX.

2010-03-10 Thread Ivan Miljenovic
On 11 March 2010 09:14, David Place d...@vidplace.com wrote: $ cabal install wx Resolving dependencies... cabal: cannot configure containers-0.3.0.0. It requires base =4.2 6 For the dependency on base =4.2 6 there are these packages: base-4.2.0.0. However none of them are available.

[Haskell-cafe] Re: definition of sum

2010-03-10 Thread TeXitoi
Daniel Fischer daniel.is.fisc...@web.de writes: Am Mittwoch 10 März 2010 22:33:43 schrieb TeXitoi: After programming as an exercice the sum function, my version is faster than the Data.List's version. Looking at the source code, Data.List uses a foldl and not a foldl'. foldl' seems faster

Re: [Haskell-cafe] Space leak

2010-03-10 Thread Daniel Fischer
Am Mittwoch 10 März 2010 23:01:28 schrieb Arnoldo Muller: Hello Daniel: Thanks! I employed mapM'_ but I am still getting the space leak. Any other hint? Hmm, offhand, I don't see why that isn't strict enough. With some datafiles, I could try to investigate. One question, how does programme

Re: [Haskell-cafe] generalized newtype deriving allows the definition of otherwise undefinable functions

2010-03-10 Thread wren ng thornton
Wolfgang Jeltsch wrote: Hello, some time ago, it was pointed out that generalized newtype deriving could be used to circumvent module borders. Now, I found out that generalized newtype deriving can even be used to define functions that would be impossible to define otherwise. To me, this is

Re: [Haskell-cafe] vector stream fusion, inlining and compilation time

2010-03-10 Thread Conal Elliott
Hi Max. Thanks much for passing on this info. Very encouraging news! - Conal On Wed, Mar 10, 2010 at 8:41 AM, Max Bolingbroke batterseapo...@hotmail.com wrote: This is my understanding: Old story (GHC 6.12.1 (?) and below): 1) Function bodies are only optimised if they are not marked

Re: [Haskell-cafe] Problem installing wxHaskell on Haskell Platform on OSX.

2010-03-10 Thread Daniel Fischer
Am Mittwoch 10 März 2010 23:31:15 schrieb Ivan Miljenovic: On 11 March 2010 09:14, David Place d...@vidplace.com wrote: $ cabal install wx Resolving dependencies... cabal: cannot configure containers-0.3.0.0. It requires base =4.2 6 For the dependency on base =4.2 6 there are these

Re: [Haskell-cafe] Problem installing wxHaskell on Haskell Platform on OSX.

2010-03-10 Thread David Place
On Mar 10, 2010, at 6:33 PM, Daniel Fischer wrote: cabal install wx-0.12.1.2 wxcore-0.12.1.2 wxdirect-0.12.1.1 has good chances to work on 6.10.* Indeed, it just finished compiling. Thank you. ___ Haskell-Cafe mailing list

[Haskell-cafe] Re: Fast Haskell Parser

2010-03-10 Thread Ben Lippmeier
Hi John, Doing a Google search for haskell parser returns the following link as its first result. That's the parser that GHC uses. http://www.haskell.org/happy/ You could also check out the following: http://www.haskell.org/haskellwiki/Parsec

[Haskell-cafe] Re: Haskell course, training

2010-03-10 Thread Johannes Waldmann
How about visiting our Haskell meeting in Leipzig, June 4th? Which I can only recommend! It has been nice last year. Thanks! We're in still in the planning stages for this year (the date and city are set, but the actual location is not). Anyway if you have a suggestion for a tutorial or a

[Haskell-cafe] ANNOUNCE: Bravo-0.1.0

2010-03-10 Thread Matthias Reisner
Hello, I'm pleased to announce the first release of Bravo, a static text template generation library, on Hackage: http://hackage.haskell.org/package/Bravo. Bravo is a text template library that provides parsing and generation of templates at compile time. Templates can be read from strings