Re: [Haskell-cafe] ANNOUNCE: citeproc-hs, a Haskell implementation of the Citation Style Language designed for Pandoc

2008-09-21 Thread Andrea Rossato
Hi Gwern, On Fri, Sep 19, 2008 at 09:01:46PM -0400, Gwern Branwen wrote: > Hi Andrea. So I was looking at the README. Does citeproc-hs only > support adding refs from a .xml file when one's written in Pandoc > markdown? That is, I don't see how I could take a .lhs file and a .bib > file and produc

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

2008-09-21 Thread Andrew Coppin
Don Stewart wrote: 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=all&lang=all Yay! This makes me very happy. ;-) __

Re: [Haskell-cafe] Line noise

2008-09-21 Thread Andrew Coppin
Mads Lindstrøm wrote: Andrew Coppin wrote: Idiomatic Haskell seems to consist *only* of single-letter variable names. The more abstract (generic) thing gets, the less likely you will be able to find a telling name. And if you cannot find a telling name, you can just as well make it sh

Re: [Haskell-cafe] Line noise

2008-09-21 Thread Andrew Coppin
Dan Piponi wrote: I suspect that most of the complaints about line noise stem from this - to beginners Haskell expressions just look like sequences of identifiers with no apparent grammar to "bind" them together. This was the exact complaint that some people voiced, yes. (The (.) and ($) op

[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=all&lang=all Just one or two more parallel programs required... Submit them here, a

Re: [Haskell-cafe] Line noise

2008-09-21 Thread Richard A. O'Keefe
On 22 Sep 2008, at 9:19 am, Albert Y. C. Lai wrote: Everyone should use exclusively ancient Egyptian iconography. It is the only universally readable language. I know this was full of (:-) (:-), but it seems like the perfect chance to mention Blissymbols. http://unicode.org/roadmaps/smp/smp-4

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 non-lin

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

[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 >

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

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 OP,

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 differe

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 space

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". Actual

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 pr

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 (

[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 your

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] [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 bei

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 =

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 com

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 th

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 H

[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 befor

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) -> "["

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/ is broken. If you're trying to find the correct link, per

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/ is broken. > If you're trying to find the correct link, perhaps it's this: http://web.cecs.p

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 foun

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 function(app

[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] 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 context

[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 Haskell-Cafe@haskell.o

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 n

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

[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] 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] 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 D

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: >

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] 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] 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 a

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] Ropes

2008-09-21 Thread Nicolas Pouillard
Excerpts from Rafael Gustavo da Cunha Pereira Pinto's message of Sat Sep 20 12:54:26 +0200 2008: > I am doing the ICFPC07 task right now, to learn Haskell and tried to use the > Sequence, but the final code is too damn slow (a few iterations per > minute!). Is your structure a sequence of *Char*s

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[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

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 a

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 imageS

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 w

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 (creat

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

2008-09-21 Thread Rafal Kolanski
Hi, I'm trying to, in addition to all the other things on my cairo surface, pull some images in from .png files. I've googled, I've looked in the docs, but there isn't any way I can see to load a .png file into a surface. The best I can find is withImageSurfaceFromPNG, but I can't make it work.

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 ti

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..

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 fi

[Haskell-cafe] Packages

2008-09-21 Thread Andrew Coppin
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 (as soon as Matthew