[Haskell-cafe] Organising teams for ICFP 2007

2007-06-29 Thread Donald Bruce Stewart
Interested in competing in the ICFP 2007 programming contest -- the hackers contest of choice! http://www.icfpcontest.org There's 2000 people on this mailing list, and 350 people in #haskell, we must be able to put together a few decent teams out of that talent pool To help people get o

Re: [Haskell-cafe] Parsers are monadic?

2007-06-29 Thread Big Chris
Hi Gregory, First post. I'm a newbie, been using Haskell for about a week and love it. Anyway, this is something I don't understand. Parsers are monadic. I can see this if the parser is reading from an input stream but if there's just a block of text can't you just have the parser call itse

[Haskell-cafe] Parsers are monadic?

2007-06-29 Thread Gregory Propf
First post. I'm a newbie, been using Haskell for about a week and love it. Anyway, this is something I don't understand. Parsers are monadic. I can see this if the parser is reading from an input stream but if there's just a block of text can't you just have the parser call itself recursivel

Re: [Haskell-cafe] Name Decoration and Undefined References

2007-06-29 Thread SevenThunders
SevenThunders wrote: > > perhaps what's contained in foo.hi that informs ghc what names to actually > link to. > > I'm not so sure if this is correct or not. The truth is I have no .hi files in the directory I try to link my test code, and yet it's somehow finding them in the cabal created

[Haskell-cafe] Name Decoration and Undefined References

2007-06-29 Thread SevenThunders
I have a very complex project that has to play nice with a lot of C code written by other people. My own code is half Haskell and half C. My build process is rather complex since I generate about 5 different libraries, some of them export Haskell routines. A supreme effort was made to try to mak

Fwd: Re: [Haskell-cafe] avoiding command window with wxHaskell on Windows?

2007-06-29 Thread Dean Herington
Date: Mon, 25 Jun 2007 20:19:50 -0400 To: Jens Fisseler <[EMAIL PROTECTED]> From: Dean Herington <[EMAIL PROTECTED]> Subject: Re: [Haskell-cafe] avoiding command window with wxHaskell on Windows? Cc: haskell-cafe@haskell.org, [EMAIL PROTECTED] At 10:10 PM +0200 6/23/07, Jens Fisseler wrote: On S

Re: [Haskell-cafe] advice: instantiating/duplicating modules

2007-06-29 Thread Dave Bayer
On Jun 29, 2007, at 10:07 AM, Nicolas Frisby wrote: I wrote a combination reader/writer monad (a la the RWS monad in the mtl) and I find myself wanting to use multiple instances of it in the same stack of transformers. The functional dependencies prevent this from working out. I found myself i

Re: [Haskell-cafe] ANNOUNCE: hiccup, a toy tcl impersonator in haskell

2007-06-29 Thread Donald Bruce Stewart
consalus: > A while back I saw a toy tcl interpreter in 550 lines of C called > 'picol'. I was looking for a simple language to implement in haskell, > so I made my own toy tcl interpreter. It was surprisingly easy to > make, thanks to the magic of Haskell and Bytestrings. :) It handles a > few th

Re: [Haskell-cafe] let vs do?

2007-06-29 Thread John Meacham
On Fri, Jun 29, 2007 at 07:26:21AM -0700, Dave Bayer wrote: > > On Jun 28, 2007, at 9:49 PM, Stefan Holdermans wrote: > > >>That way you would have to use monads everywhere. > > > >As you already hinted at in a later message, this has to do with > >let-bindings being potentially polymorphic and mon

Re: [Haskell-cafe] Updating haskell.org robots.txt

2007-06-29 Thread Ian Lynagh
On Wed, Jun 27, 2007 at 09:42:29PM -0700, Justin Bailey wrote: > > Any feedback, let me know. Thanks! Thanks for looking at this, Justin! Looks fine to me. Ian ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/list

Re: [Haskell-cafe] Language semantics

2007-06-29 Thread Jon Cast
On Friday 29 June 2007, Andrew Coppin wrote: > Jon Cast wrote: > > On Wednesday 27 June 2007, Andrew Coppin wrote: > >> Wow, wait a sec - case expressions are allowed to have guards too?? > > > > Yes. I guess I assumed you knew that, sorry. > > > > The only syntactic (or semantic) difference betwe

Re: [Haskell-cafe] Abstraction leak

2007-06-29 Thread Andrew Coppin
David Roundy wrote: On Fri, Jun 29, 2007 at 07:39:28PM +0100, Andrew Coppin wrote: Now I have a problem. It's easy enough to pass the entire data stream through an RLE decoder and feed that to the Huffman table deserialize function, and it will give be back the table. But I now have *no clue

Re: [Haskell-cafe] Abstraction leak

2007-06-29 Thread Jon Cast
On Friday 29 June 2007, Jon Cast wrote: > Here's my solution (drawn from a library I'll be posting Real Soon Now): I forgot to point out that this is 75-90% drawn from a library called Fudgets[1], which is probably the most extended practical meditation to date on programming with lazy streams

Re: [Haskell-cafe] HGL on Windows

2007-06-29 Thread Paul Hudak
Unfortunately your memory serves you well -- see: http://hackage.haskell.org/trac/ghc/ticket/742     -Paul peterv wrote: I vaguely  remember to have read that HGL is (currently) not supported on Windows, but I can’t find this information any more.   Is this correct? It s

Re: [Haskell-cafe] Abstraction leak

2007-06-29 Thread Jon Cast
On Friday 29 June 2007, Andrew Coppin wrote: > ...and again today I found myself trying to do something that would be > very easy in an imperative language, but I cannot think of a single good > way of doing it in Haskell. Hopfully somebody can give me some hints. > Here's my solution (drawn from

RE: [Haskell-cafe] Best idiom for avoiding Defaulting warnings with ghc -Wall -Werror ??

2007-06-29 Thread Simon Peyton-Jones
| By the way, using Integer for exponents really shouldn't be less | efficient - | but it seems it is. | | The code for (^) should be something like this: | | {-# INLINE ^ #-} | n ^ m = case toInteger m of | S# i -> powerInt# n i | J# a p -> powerGmp n a p I've done something l

Re: [Haskell-cafe] formatTime %Q not working

2007-06-29 Thread Ian Lynagh
On Thu, Jun 21, 2007 at 05:39:12PM +0300, Bit Connor wrote: > > >now <- getCurrentTime > 2007-06-21 13:48:44.298699 UTC > >formatTime defaultTimeLocale "%s" now > "1182433724" > >formatTime defaultTimeLocale "%Q" now > "" > > "%q" also always gives me an empty string. It seems to work OK for me

Re: [Haskell-cafe] Language semantics

2007-06-29 Thread David House
Andrew Coppin writes: > I wonder what the layout for that is... something like this? > > case foo of > patter1 > | guard1 -> ... > | guard2 -> ... > pattern2 > | guard3 -> ... > | guard4 -> ... Something like that should work. If the patterns are more in

Re: [Haskell-cafe] Abstraction leak

2007-06-29 Thread David Roundy
On Fri, Jun 29, 2007 at 07:39:28PM +0100, Andrew Coppin wrote: > Now I have a problem. It's easy enough to pass the entire data stream > through an RLE decoder and feed that to the Huffman table deserialize > function, and it will give be back the table. But I now have *no clue* > where the tabl

Re: [Haskell-cafe] Abstraction leak

2007-06-29 Thread Miles Sabin
Andrew Coppin wrote, > If this was Java, you would write all these compression and > decompression stages as stream wrappers. So you wrap the raw input > stream with an RLE decoder, have the function read the Huffman table, > and then take off the RLE decoder and process the rest of the stream. Ex

[Haskell-cafe] HGL on Windows

2007-06-29 Thread peterv
I vaguely remember to have read that HGL is (currently) not supported on Windows, but I can't find this information any more. Is this correct? It seems not to be included in GHC 6.6 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Language semantics

2007-06-29 Thread Mark T.B. Carroll
Andrew Coppin <[EMAIL PROTECTED]> writes: (snip) > Woah... Let me sit down and grok that for an hour or two. o_o The Haskell learning curve - including the wonderful range of useful generic stuff you can do with it - extends way higher than for many other languages, I think, though you can write l

Re: [Haskell-cafe] Language semantics

2007-06-29 Thread Andrew Coppin
Stefan O'Rear wrote: On Fri, Jun 29, 2007 at 07:18:00PM +0100, Andrew Coppin wrote: Well, let me show you the code - somebody will probably recognise this stuff... convert1 :: Expression -> Expression convert1 S = S convert1 K = K convert1 I = I convert1 (Var v) = Var v convert1 (x :@: y) =

Re: [Haskell-cafe] Abstraction leak

2007-06-29 Thread Andrew Coppin
Miles Sabin wrote: Andrew Coppin wrote, If this was Java, you would write all these compression and decompression stages as stream wrappers. So you wrap the raw input stream with an RLE decoder, have the function read the Huffman table, and then take off the RLE decoder and process the rest o

Re: [Haskell-cafe] Language semantics

2007-06-29 Thread Stefan O'Rear
On Fri, Jun 29, 2007 at 07:18:00PM +0100, Andrew Coppin wrote: > Dan Mead wrote: > >Andrew: Try using catchalls in your guards > > > > > >pattern1 > >| guard1 = > >| guard2 = > >| otherwise = > > > >This makes it much easier to use pattern guards. > >"otherwise" is a reserved word used for this stu

[Haskell-cafe] Abstraction leak

2007-06-29 Thread Andrew Coppin
...and again today I found myself trying to do something that would be very easy in an imperative language, but I cannot think of a single good way of doing it in Haskell. Hopfully somebody can give me some hints. I'm writing a whole bunch of data compression programs. In particular, one of th

Re: [Haskell-cafe] Language semantics

2007-06-29 Thread Andrew Coppin
Dan Mead wrote: Andrew: Try using catchalls in your guards pattern1 | guard1 = | guard2 = | otherwise = This makes it much easier to use pattern guards. "otherwise" is a reserved word used for this stuff in ghc. Yeah, it's good practice to include an explicit otherwise clause - but in this

Re: [Haskell-cafe] Language semantics

2007-06-29 Thread Andrew Coppin
Jon Cast wrote: On Wednesday 27 June 2007, Andrew Coppin wrote: Wow, wait a sec - case expressions are allowed to have guards too?? Yes. I guess I assumed you knew that, sorry. The only syntactic (or semantic) difference between function equations and case expressions (aside from th

Re: [Haskell-cafe] Language semantics

2007-06-29 Thread Andrew Coppin
Jon Cast wrote: Anyway, the second tutorial is correct: if all guards on pattern1 fail, pattern2 will be tried next. See Section 3.17.3 in the Haskell Report [1]. Btw., which was the first tutorial? Unfortunately, I cannot remember. ___ Haskell

Re: [Haskell-cafe] advice: instantiating/duplicating modules

2007-06-29 Thread Arie Peterson
Nicolas Frisby wrote: | I wrote a combination reader/writer monad (a la the RWS monad in the | mtl) and I find myself wanting to use multiple instances of it in the | same stack of transformers. The functional dependencies prevent this | from working out. The class is called MonadRW and the transf

Re: [Haskell-cafe] Re: Tree Guidance

2007-06-29 Thread Thomas Schilling
On 27 jun 2007, at 18.41, Hans van Thiel wrote: [snip] Thanks, Apfelmus, for the references. Guess I'll start there, then. And thanks, Chris, for the info and code. Read only 'up pointers' could be what is needed. But before going on, I want first to get more confortable with programming wi

[Haskell-cafe] ANNOUNCE: hiccup, a toy tcl impersonator in haskell

2007-06-29 Thread Kyle Consalus
A while back I saw a toy tcl interpreter in 550 lines of C called 'picol'. I was looking for a simple language to implement in haskell, so I made my own toy tcl interpreter. It was surprisingly easy to make, thanks to the magic of Haskell and Bytestrings. :) It handles a few things incorrectly, a

Re: [Haskell-cafe] let vs do?

2007-06-29 Thread Thomas Schilling
On 29 jun 2007, at 16.26, Dave Bayer wrote: That way you would have to use monads everywhere. As you already hinted at in a later message, this has to do with let-bindings being potentially polymorphic and monadic bindings being necessarily monomorphic: Are there papers that prove this ne

Re: [Haskell-cafe] advice: instantiating/duplicating modules

2007-06-29 Thread Bulat Ziganshin
Hello Nicolas, Friday, June 29, 2007, 9:07:38 PM, you wrote: > I'm rather unfamiliar with Template Haskell, but it sounds like it > might fit the bill. Although, if I recall correctly, instances and > type declarations splicing are yet to be implemented in GHC? instances - definitely not. i've u

[Haskell-cafe] advice: instantiating/duplicating modules

2007-06-29 Thread Nicolas Frisby
I wrote a combination reader/writer monad (a la the RWS monad in the mtl) and I find myself wanting to use multiple instances of it in the same stack of transformers. The functional dependencies prevent this from working out. The class is called MonadRW and the transformer is called RWT. I find m

Re: [Haskell-cafe] let vs do?

2007-06-29 Thread Philippa Cowderoy
On Fri, 29 Jun 2007, Dave Bayer wrote: > One is immediately led back to the same idea as Haskell do expressions: > Two pieces of program, juxtaposed next to each other, silently > "multiply" to combine into a larger program, with type rules guiding the > multiplication process. > They don't,

Re: [Haskell-cafe] let vs do?

2007-06-29 Thread Arie Peterson
Dave Bayer wrote: > [...] In the Haskell do expression, every line is equally special, > and type information is used to combine the lines, inserting implied > combinators.[...] Desugaring do-notation is a syntactic transformation, requiring no type information. (In practice, the parts may be req

Re: [Haskell-cafe] ANN: newports.hs utility for freebsd

2007-06-29 Thread brad clawsie
> What is the advantage of using Haskell in this case? bryan is correct! i hesitated to even bother the cafe list with this, considering it is so trivial, but i just wanted to learn a bit more about haskell's file and directory functionality, and this bit of code may be something others can look

RE: [Haskell-cafe] Newbie question: alternative for toInt/fromInt

2007-06-29 Thread peterv
That would be too easy ;) Coming from C++, that was the first I tried too. But in Haskell, an Win32.INT is not an Int: GraphicsTypes.hs:46:16: Couldn't match expected type `Dimension' against inferred type `Win32.INT' In the expression: id In the definition of `toDimension':

Re: [Haskell-cafe] let vs do?

2007-06-29 Thread Dave Bayer
On Jun 28, 2007, at 9:49 PM, Stefan Holdermans wrote: That way you would have to use monads everywhere. As you already hinted at in a later message, this has to do with let-bindings being potentially polymorphic and monadic bindings being necessarily monomorphic: Are there papers that p

Re: [Haskell-cafe] ANN: newports.hs utility for freebsd

2007-06-29 Thread Bryan Burgers
On 6/29/07, brad clawsie <[EMAIL PROTECTED]> wrote: i have written a small haskell program to solve a problem many users of freebsd may have - knowing what ports have been updated after a daily/weekly etc cvsup. this is a trivial bit of coding hardly worth attention, but if it might be of use to