Re: [Haskell-cafe] let vs do?

2007-06-29 Thread Stefan Holdermans
Thomas, let x = ... in ... is only equal do x - ...; ... in the Identity monad. Also, why would do be more primitive than let. That way you would have to use monads everywhere. Also, let is treated specially by the type checker (IIRC) and there are many, many other reasons not

Re: [Haskell-cafe] let vs do?

2007-06-29 Thread Greg Meredith
Thomas, Stefan, Thanks for a most edifying exchange! i will reflect on this. Best wishes, --greg On 6/28/07, Stefan Holdermans [EMAIL PROTECTED] wrote: Thomas, let x = ... in ... is only equal do x - ...; ... in the Identity monad. Also, why would do be more primitive than

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

2007-06-29 Thread Donald Bruce Stewart
clawsie: 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 you, you can find it here:

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

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

[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

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

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

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

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

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

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

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 indented than

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 with GHC 6.6.1 and

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

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. snip long and helpful explanation

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 cant find this information any more. Is this correct? It seems

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): snip solution 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

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

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 between function

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

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 monadic

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 things

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

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

[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

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