Re: [Haskell-cafe] ANNOUNCE: graphviz-2008.9.20

2008-09-21 Thread Don Stewart
ivan.miljenovic: The latest version of Matthew Sackman's Haskell bindings to Graphviz [1] are now available on Hackage [2]. The reason there's a new release only two weeks after the previous one is that I've made some extensions to it (hence why I'm writing the announcement) that Matthew has

Re: [Haskell-cafe] ANNOUNCE: graphviz-2008.9.20

2008-09-21 Thread Ivan Lazar Miljenovic
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sat, 20 Sep 2008 23:38:16 -0700 Don Stewart [EMAIL PROTECTED] wrote: And by now you know where which distro has it: http://aur.archlinux.org/packages.php?ID=18343 I'm sorry, Don, but you're late... Gentoo had it last night (as soon

Re: [Haskell-cafe] Packages

2008-09-21 Thread Austin Seipp
Excerpts from Andrew Coppin's message of Sun Sep 21 02:44:10 -0500 2008: 1. How is putting something into a Cabal package different from just handing somebody the source code and telling them to run ghc --make? Cabal can handle things for you like when your package depends on external data

Re: [Haskell-cafe] Packages

2008-09-21 Thread Don Stewart
andrewcoppin: Ivan Lazar Miljenovic wrote: On Sat, 20 Sep 2008 23:38:16 -0700 Don Stewart [EMAIL PROTECTED] wrote: And by now you know where which distro has it: http://aur.archlinux.org/packages.php?ID=18343 I'm sorry, Don, but you're late... Gentoo had it last night

Re: [Haskell-cafe] OpenSPARC project applicant chosen

2008-09-21 Thread Bulat Ziganshin
Hello Duncan, Saturday, September 20, 2008, 7:37:08 PM, you wrote: http://haskell.org/opensparc/ the page says that you still search for a student how community server may be used to measure performance? i'm interested in doing some benchmarks but afaiu this needs exclusive access for some

Re: [Haskell-cafe] Drawing an existing image into a cairo surface?

2008-09-21 Thread Austin Seipp
Excerpts from Rafal Kolanski's message of Sun Sep 21 07:28:37 -0500 2008: The best I can find is withImageSurfaceFromPNG, but I can't make it work. Why not? Seems to me all you need to do is: withImageSurfaceFromPNG blah.png $ \surface - do ... Lots of code is written this way (create a

Re: [Haskell-cafe] Drawing an existing image into a cairo surface?

2008-09-21 Thread Rafal Kolanski
Austin Seipp wrote: Excerpts from Rafal Kolanski's message of Sun Sep 21 07:28:37 -0500 2008: The best I can find is withImageSurfaceFromPNG, but I can't make it work. Why not? Seems to me all you need to do is: withImageSurfaceFromPNG blah.png $ \surface - do ... Lots of code is

Re: [Haskell-cafe] Drawing an existing image into a cairo surface?

2008-09-21 Thread Rafal Kolanski
I finally came up with a solution that suits my context. For those interested, I'm supplying it here. Safely get a surface containing your .png image (note that the surface has to be freed when you're done with it using surfaceFinish) imageSurfaceCreateFromPNG :: FilePath - IO Surface

Re: [Haskell-cafe] Packages

2008-09-21 Thread Andrew Coppin
Austin Seipp wrote: Cabal can handle things for you like when your package depends on external data files; when cabal compiles the code it autogenerates a module which you import that will give you the path name to where-ever it is installed, which is nifty in case you for example are uploading

Re[2]: [Haskell-cafe] Drawing an existing image into a cairo surface?

2008-09-21 Thread Bulat Ziganshin
Hello Rafal, Sunday, September 21, 2008, 5:43:14 PM, you wrote: withImageSurfaceFromPNG file $ \png - do w - renderWith png $ imageSurfaceGetWidth png h - renderWith png $ imageSurfaceGetHeight png this is very idiomatic Haskell, consider it as a sort of RAII. you may

Re: [Haskell-cafe] Drawing an existing image into a cairo surface?

2008-09-21 Thread Rafal Kolanski
Bulat Ziganshin wrote: afair, Render is a super-IO monad so you can just lift any IO operation to Render: x - liftIO$ imageSurfaceCreateFromPNG file You are indeed correct. I feel really silly now, using unsafePerformIO in the IO monad. D'oh! Thank you very much! Rafal Kolanski.

Re: [Haskell-cafe] Re: Iteratee-based IO

2008-09-21 Thread Adam Langley
On Sat, Sep 20, 2008 at 8:17 PM, Don Stewart [EMAIL PROTECTED] wrote: Wonderful. Thanks Oleg, I'll be studying these on the trip up to Victoria. See you there! Something similar is available in binary-strict[1], although there I have (versions of) IE_Done, IE_Cont and (additionally) IE_Fail,

Re: [Haskell-cafe] Parsing arguments and reading configuration

2008-09-21 Thread Sterling Clover
Alternately, just go with a map initially with default values. Then parse the command line args into a second map (especially if they're all of a format like -argname argvalue). Then lookup your args file with the command line map, and failing that the default map. Then read the args file

Re: [Haskell-cafe] Hugs on the iphone

2008-09-21 Thread Alberto R. Galdo
And there it is! Hugs98 is now available for installation on the iphone/ipod touch. It is being served through the community sources at cydia, one the most official unofficial installers for pwnaged iphone/ipods. That means that if you have cydia already installed, if you look for hugs98 in the

Re: [Haskell-cafe] Drawing an existing image into a cairo surface?

2008-09-21 Thread Jefferson Heard
Sorry. In a hurry, and I don't have a lot of time to read the message, so if I'm offering a lot of info you already have, I apologize. The best thing to do is to allocate either a pixmap or Gtk.DrawingArea -- you can then use widgetGetDrawable to get the drawing context from it and newGC to take

Re: [Haskell-cafe] OpenSPARC project applicant chosen

2008-09-21 Thread Brent Yorgey
On Sat, Sep 20, 2008 at 11:03:41PM +0100, Duncan Coutts wrote: On Sat, 2008-09-20 at 23:50 +0300, Roman Cheplyaka wrote: * Duncan Coutts [EMAIL PROTECTED] [2008-09-20 16:37:08+0100] If you want to follow the progress we will be using the existing ghc development mailing list:

[Haskell-cafe] The ultimate insult?

2008-09-21 Thread Andrew Coppin
Delphi is usable. If you're a single hobbiest programmer, use whatever gets the job done. But as far as a career goes, I'd say even Haskell has better prospects than Delphi. So even Haskell is better? Ouch! Still, in a bank-handed kind of way, I guess that means Haskell isn't as dead as

Re: [Haskell-cafe] haskell shootout -- mandelbrot

2008-09-21 Thread Tim Newsham
Here's a whack at regex-dna: http://haskell.org/haskellwiki/Shootout/Parallel/RegexDNA only modest speedup (memory bw bound?). A regex engine that could run several machines concurrently in one pass would prob be a big win. Tim Newsham http://www.thenewsh.com/~newsham/

[Haskell-cafe] Line noise

2008-09-21 Thread Andrew Coppin
I hang out on another forum that is populated by various kinds of computer geeks. There's a fair few programmers in there, as well as nerds of every degree. And yet, every time I post anything written in Haskell, everybody complains that it looks like line noise. What do normal programmers

Re: [Haskell-cafe] The ultimate insult?

2008-09-21 Thread Micah Cowan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andrew Coppin wrote: Delphi is usable. If you're a single hobbiest programmer, use whatever gets the job done. But as far as a career goes, I'd say even Haskell has better prospects than Delphi. So even Haskell is better? Ouch! Oh come on...

Re: [Haskell-cafe] Line noise

2008-09-21 Thread Philippa Cowderoy
On Sun, 21 Sep 2008, Andrew Coppin wrote: Actually, none of these things were mentioned. The things people have *actually* complained to me about are: - Haskell expressions are difficult to parse. This is partly an it's not braces, semicolons and function(application) complaint, though not

[Haskell-cafe] broken link in documentation

2008-09-21 Thread Manlio Perillo
Hi. Sorry if I use the mailing list for this, but in the documentation of Control.Monad.RWS (and the other Control.Monad.* modules), the link http://www.cse.ogi.edu/~mpj/ is broken. Manlio Perillo ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Drawing an existing image into a cairo surface?

2008-09-21 Thread Rafal Kolanski
Jefferson Heard wrote: Sorry. In a hurry, and I don't have a lot of time to read the message, so if I'm offering a lot of info you already have, I apologize. The best thing to do is to allocate either a pixmap or Gtk.DrawingArea -- you can then use widgetGetDrawable to get the drawing

[Haskell-cafe] Bird-style and blank lines

2008-09-21 Thread Paulo Tanimoto
Hi, I'm a big fan of literate haskell, especially Bird-style, but there's one behavior that I find rather annoying: the requirement that code be preceded and followed by a blank line. Quoth the Report: To capture some cases where one omits an by mistake, it is an error for a program line to

Re: [Haskell-cafe] Line noise

2008-09-21 Thread Andrew Coppin
Philippa Cowderoy wrote: On Sun, 21 Sep 2008, Andrew Coppin wrote: Actually, none of these things were mentioned. The things people have *actually* complained to me about are: - Haskell expressions are difficult to parse. This is partly an it's not braces, semicolons and

Re: [Haskell-cafe] Updated formlets sample?

2008-09-21 Thread Martin Huschenbett
Hi Chris, thanks for the updated example. Compiling works now. But when I try to run it I alway get error messages like [input0 is not in the data,input1 is not in the data] Regards, Martin. Chris Eidhof schrieb: Hey Martin, On 19 sep 2008, at 04:14, Martin Huschenbett wrote: I found a

Re: [Haskell-cafe] broken link in documentation

2008-09-21 Thread Sean Leather
Sorry if I use the mailing list for this, but in the documentation of Control.Monad.RWS (and the other Control.Monad.* modules), the link http://www.cse.ogi.edu/~mpj/ http://www.cse.ogi.edu/%7Empj/ is broken. If you're trying to find the correct link, perhaps it's this:

Re: [Haskell-cafe] broken link in documentation

2008-09-21 Thread Manlio Perillo
Sean Leather ha scritto: Sorry if I use the mailing list for this, but in the documentation of Control.Monad.RWS (and the other Control.Monad.* modules), the link http://www.cse.ogi.edu/~mpj/ http://www.cse.ogi.edu/%7Empj/ is broken. If you're trying to find the correct link,

Re: [Haskell-cafe] Line noise

2008-09-21 Thread Claus Reinke
I posted a snippet of code which included the phrase mapM_ (\(n,v) - putStrLn $ [ ++ show n ++ ] = ++ show v) (zip [0..] vs) Don't do that, then?-) mapM_ putStrLn $ map (\(n,v) - [ ++ show n ++ ] = ++ show v) (zip [0..] vs) - mapM_ putStrLn $ map (\(n,v) - [ ++ show n ++ ]

[Haskell-cafe] Re: Bird-style and blank lines

2008-09-21 Thread John MacFarlane
3. Pandoc, via markdown, is a very interesting alternative to latex. Right now you can write a block of code like this: ~~~ fact :: Integer - Integer fact 0 = 1 fact n = n * fact (n-1) ~~~ except that that won't work, precisely because you must have a blank line before and after

Re: [Haskell-cafe] Line noise

2008-09-21 Thread Mads Lindstrøm
Andrew Coppin wrote: Idiomatic Haskell seems to consist *only* of single-letter variable names. When did you last see a pattern like (customer:customers)? No, it'd be (c:cs), which isn't very self-documenting. Ditto for type variables by the way. (Map k v, anyone?) It also seems to be

Re: [Haskell-cafe] Line noise

2008-09-21 Thread Albert Y. C. Lai
I read from many reviews and shootouts that cell phones sold in Japan are more diverse, advanced, and user-friendly than cell phones sold in the US. So I bought one, but to my dismay, both the offline manual and the on-screen menu are line noise. Then I found a web dictionary to translate

Re: [Haskell-cafe] Parsing arguments and reading configuration

2008-09-21 Thread Magnus Therning
On Sun, Sep 21, 2008 at 4:02 PM, Sterling Clover [EMAIL PROTECTED] wrote: Alternately, just go with a map initially with default values. Then parse the command line args into a second map (especially if they're all of a format like -argname argvalue). Then lookup your args file with the command

Re: [Haskell-cafe] Language.Haskell and strings

2008-09-21 Thread Sukit Tretriluxana
I'm not a Haskell expert but here the solution to your problem that I can think of. import Data.List prettyStr :: Int - String - IO () prettyStr maxlen str = do putStr (\ ++ head brokenStr) mapM_ (\str - putStr (\\\n\\ ++ str)) (tail brokenStr) putStr \\n where brokenStr = map

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

2008-09-21 Thread Richard A. O'Keefe
Erlang's equivalent of [m..n] is lists:seq(M, N), which is currently defined to raise an exception when N M. In particular, lists:seq(1, N) returns a list of length N when N 0, but not when N = 0. I'm currently arguing that lists:seq(1, 0) should be [], not an exception. Oddly enough, I'm

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

2008-09-21 Thread ajb
G'day all. Quoting Richard A. O'Keefe [EMAIL PROTECTED]: I'm currently arguing that lists:seq(1, 0) should be [], not an exception. Oddly enough, I'm being beaten over the head with Haskell, of all things. [...] Does anyone remember why the definition of enumFromTo is the way it is? I

[Haskell-cafe] Re: Language.Haskell and strings

2008-09-21 Thread Maurí­cio
Ed, thanks for your code. However, I need to use something that fits inside the whole pretty-print engine. I would like to call parseModule in some string of Haskell code and get it nicely typed, with those big strings inside. Best, Maurício I'm not a Haskell expert but here the solution to

Re: [Haskell-cafe] Language.Haskell and strings

2008-09-21 Thread Sterling Clover
A quick glance at the code reveals that there's an instance of Pretty like such: instance Pretty HsLiteral where pretty (HsInt i)= integer i pretty (HsChar c) = text (show c) pretty (HsString s) = text (show s) pretty (HsFrac r) = double

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

2008-09-21 Thread Evan Laforge
In Haskell, The sequence enumFromTo e1 e3 is the list [e1,e1+1,e1+2,...e3]. The list is empty if e1 e3. I like it, since it means that things like [n .. n + length m - 1] work as expected when m is []. Or say 'map (array!) [bsearch x .. bsearch y - 1]'. Tangent: Of course, I would prefer

Re: [Haskell-cafe] Line noise

2008-09-21 Thread wren ng thornton
Andrew Coppin wrote: I hang out on another forum that is populated by various kinds of computer geeks. There's a fair few programmers in there, as well as nerds of every degree. And yet, every time I post anything written in Haskell, everybody complains that it looks like line noise.

Re: [Haskell-cafe] Line noise

2008-09-21 Thread Dan Piponi
On Sun, Sep 21, 2008 at 7:49 PM, wren ng thornton [EMAIL PROTECTED] wrote: We inherited our use of spaces for function application from Lisp and friends, so foo bar baz looks perfectly natural to functionalists. But to those used to seeing foo(bar, baz) the meaning attached to the spaces is

Re: [Haskell-cafe] Bird-style and blank lines

2008-09-21 Thread wren ng thornton
Paulo Tanimoto wrote: [1] I don't think it's that common to add a by accident. By intention, probably. But by accident it is a lot more common than you might think. Accidents like corrupting the linebreaks or line wrapping in a file are quite prevalent when exchanging files across different

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

2008-09-21 Thread wren ng thornton
[EMAIL PROTECTED] wrote: Having said that, I don't know of a good reason why [5,5..5] is an infinte list of 5's. I'm sure you know *why* it's an infinite list[1], but as for why that's useful I can't say. It has the feel of a bug in implementation, though it is ...consistent. As for the

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

2008-09-21 Thread ajb
G'day. Quoting wren ng thornton [EMAIL PROTECTED]: I'm sure you know *why* it's an infinite list[1], but as for why that's useful I can't say. It has the feel of a bug in implementation, though it is ...consistent. Right. I have no problem with [5,5..5] being logically an anamorphism, but

[Haskell-cafe] Re: Bird-style and blank lines

2008-09-21 Thread Paulo Tanimoto
Hi John, On Sun, Sep 21, 2008 at 3:33 PM, John MacFarlane [EMAIL PROTECTED] wrote: Note: I've changed pandoc in the repository so that it no longer shows these blank lines. The next point release will incorporate this change, making it easier to use pandoc for literate haskell. Note also that

Re: [Haskell-cafe] Bird-style and blank lines

2008-09-21 Thread Paulo Tanimoto
Hello Wren, On Sun, Sep 21, 2008 at 10:02 PM, wren ng thornton [EMAIL PROTECTED] wrote: By intention, probably. But by accident it is a lot more common than you might think. Accidents like corrupting the linebreaks or line wrapping in a file are quite prevalent when exchanging files across

Re: [Haskell-cafe] Line noise

2008-09-21 Thread donn cave
Quoth Andrew Coppin [EMAIL PROTECTED]: ... | As one experienced C++ programmer put it, there is no clear flow from | left to right or right to left. Personally I found that a little ironic | comming from the language that gave us | | while (*x++ = *y++) { } | | which is every bit as

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

2008-09-21 Thread Don Stewart
Thanks to those guys who've submitted parallel programs to the language benchmarks game, we're climbing up the rankings, now in 3rd, and ahead of C :) http://shootout.alioth.debian.org/u64q/benchmark.php?test=alllang=all Just one or two more parallel programs required... Submit them here,