Re: [Haskell-cafe] How to use bracket properly ?

2009-10-19 Thread zaxis
thanks for your quick answer. But winSSQ count noRed noBlue = do { let yesRed = [1..33] \\ noRed; let yesBlue = [1..16] \\ noBlue; bracket (openFile ssqNum.txt WriteMode) (hClose) (\hd1 - pickSSQ count yesRed yesBlue hd1); } will report: parse error on input `let' Daniel Peebles

Re: [Haskell-cafe] How to use bracket properly ?

2009-10-19 Thread Thomas DuBuisson
thanks for your quick answer. But I think he actually answered your question. I.e. try it with this extra 'do' statement: winSSQ count noRed noBlue = do { do    let yesRed =  [1..33] \\ noRed;    let yesBlue = [1..16] \\ noBlue;    bracket (openFile ssqNum.txt WriteMode) (hClose) (\hd1 -

Re: [Haskell-cafe] How to use bracket properly ?

2009-10-19 Thread zaxis
The original code is: winSSQ count noRed noBlue = do let yesRed = [1..33] \\ noRed let yesBlue = [1..16] \\ noBlue bracket (openFile ssqNum.txt WriteMode) (hClose) (\hd1 - pickSSQ count yesRed yesBlue hd1) It works very well. However, as i am used to C style so i want convert it

[Haskell-cafe] Re: How to use bracket properly ?

2009-10-19 Thread Heinrich Apfelmus
zaxis wrote: It works very well. However, as i am used to C style so i want convert it into winSSQ count noRed noBlue = do { let yesRed = [1..33] \\ noRed; let yesBlue = [1..16] \\ noBlue; bracket (openFile ssqNum.txt WriteMode) (hClose) (\hd1 - pickSSQ count yesRed yesBlue

Re: [Haskell-cafe] How to use bracket properly ?

2009-10-19 Thread Ketil Malde
zaxis z_a...@163.com writes: winSSQ count noRed noBlue = do let yesRed = [1..33] \\ noRed let yesBlue = [1..16] \\ noBlue bracket (openFile ssqNum.txt WriteMode) (hClose) (\hd1 - pickSSQ count yesRed yesBlue hd1) It works very well. However, as i am used to C style so i want

Re: [Haskell-cafe] How to use bracket properly ?

2009-10-19 Thread Dougal Stanton
On Mon, Oct 19, 2009 at 9:18 AM, Ketil Malde ke...@malde.org wrote: zaxis z_a...@163.com writes: winSSQ count noRed noBlue = do     let yesRed =  [1..33] \\ noRed     let yesBlue = [1..16] \\ noBlue     bracket (openFile ssqNum.txt WriteMode) (hClose) (\hd1 - pickSSQ count yesRed yesBlue

Re: [Haskell-cafe] How to use bracket properly ?

2009-10-19 Thread Miguel Mitrofanov
Ketil Malde wrote: winSSQ count noRed noBlue = do { let yesRed = [1..33] \\ noRed; ^^^ ^ Didn't you just comment out your semicolons? That was my initial reaction. Until I remembered that Haskell has a different comment style.

Re: [Haskell-cafe] How to use bracket properly ?

2009-10-19 Thread Ketil Malde
Ketil Malde ke...@malde.org writes: Didn't you just ... Oh, dear. Sorry about that. -k -- If I haven't seen further, it is by standing in the footprints of giants ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Hackage down

2009-10-19 Thread Dougal Stanton
Has not been responding for at least the last 12 hours. Is there somewhere to look for status reports on sysadmin details like this, so we can tell if - it's a scheduled down time - it's a problem but the admins know about it - etc etc. D -- Dougal Stanton dou...@dougalstanton.net //

Re: [Haskell-cafe] Hackage down

2009-10-19 Thread Deniz Dogan
2009/10/19 Dougal Stanton dou...@dougalstanton.net: Has not been responding for at least the last 12 hours. Is there somewhere to look for status reports on sysadmin details like this, so we can tell if - it's a scheduled down time - it's a problem but the admins know about it - etc etc.

Re: [Haskell-cafe] Hackage down

2009-10-19 Thread Ross Paterson
On Mon, Oct 19, 2009 at 09:30:55AM +0100, Dougal Stanton wrote: Has not been responding for at least the last 12 hours. Is there somewhere to look for status reports on sysadmin details like this, so we can tell if - it's a scheduled down time - it's a problem but the admins know about it

Re: [Haskell-cafe] How to use bracket properly ?

2009-10-19 Thread zaxis
oh! thanks! But why ? Heinrich Apfelmus wrote: zaxis wrote: It works very well. However, as i am used to C style so i want convert it into winSSQ count noRed noBlue = do { let yesRed = [1..33] \\ noRed; let yesBlue = [1..16] \\ noBlue; bracket (openFile ssqNum.txt

Re: [Haskell-cafe] How to use bracket properly ?

2009-10-19 Thread Roel van Dijk
On Mon, Oct 19, 2009 at 1:44 PM, zaxis z_a...@163.com wrote: oh! thanks!  But why ? A let can introduce multiple declarations. So this foo = do let x = 3 let y = 4 return $ x+ y can also be written like foo = do let x = 3 y = 4 -- no let return $ x + y With explicit blocks:

Re: [Haskell-cafe] Documentation (was: ANN: text 0.5, a major revision of the Unicode text library)

2009-10-19 Thread José Pedro Magalhães
Hi, While I agree that the documentation of Data.Generics is not perfect, I do not think it is possible to have the haddock documentation be self-contained. For a thorough understanding of syb, a user has to read the two initial papers, which are linked from the haddock documentation. I also do

Re: [Haskell-cafe] How to use bracket properly ?

2009-10-19 Thread Luke Palmer
On Mon, Oct 19, 2009 at 6:10 AM, Roel van Dijk vandijk.r...@gmail.com wrote: On Mon, Oct 19, 2009 at 1:44 PM, zaxis z_a...@163.com wrote: oh! thanks!  But why ? A let can introduce multiple declarations. So this foo = do  let x = 3  let y = 4  return $ x+ y can also be written like

Re: [Haskell-cafe] Hackage down

2009-10-19 Thread Sebastiaan Visser
On Oct 19, 2009, at 12:18 PM, Ross Paterson wrote: On Mon, Oct 19, 2009 at 09:30:55AM +0100, Dougal Stanton wrote: Has not been responding for at least the last 12 hours. Is there somewhere to look for status reports on sysadmin details like this, so we can tell if - it's a scheduled down

Re: [Haskell-cafe] Error handling package

2009-10-19 Thread Jose Iborra
You may want to take a look at another option in Hackage, the control- monad-exception package. http://pepeiborra.github.com/control-monad-exception/ The control-monad-exception library provides the building blocks for * Explicitly Typed exceptions (checked or not) * which are composable *

Re: [Haskell-cafe] Hackage down

2009-10-19 Thread Tom Tobin
On Mon, Oct 19, 2009 at 3:30 AM, Dougal Stanton dou...@dougalstanton.net wrote: Has not been responding for at least the last 12 hours. Is there somewhere to look for status reports on sysadmin details like this, so we can tell if Or even better, might it be possible to look into setting up a

Re: [Haskell-cafe] \Statically checked binomail heaps?

2009-10-19 Thread Wouter Swierstra
Hi Maciej, insTree t [] = [t] insTree t ts@(t':ts') | rank t rank t' = t : ts | otherwise = insTree (link t t') ts' In a way, it's unsurprising that this is where your code breaks. What you're doing here is using a boolean guard to determine where to insert. The problem is that ghc's

Re: [Haskell-cafe] Hackage down

2009-10-19 Thread Don Stewart
sfvisser: On Oct 19, 2009, at 12:18 PM, Ross Paterson wrote: On Mon, Oct 19, 2009 at 09:30:55AM +0100, Dougal Stanton wrote: Has not been responding for at least the last 12 hours. Is there somewhere to look for status reports on sysadmin details like this, so we can tell if - it's a

Re: [Haskell-cafe] Error handling package

2009-10-19 Thread Michael Snoyman
On Mon, Oct 19, 2009 at 3:39 PM, Jose Iborra pepeibo...@gmail.com wrote: You may want to take a look at anoother option in Hackage, the control-monad-exception package. http://pepeiborra.github.com/control-monad-exception/ The control-monad-exception library provides the building blocks for

Re: [Haskell-cafe] How to use bracket properly ?

2009-10-19 Thread Evan Laforge
On Sun, Oct 18, 2009 at 11:50 PM, zaxis z_a...@163.com wrote: The original code is: winSSQ count noRed noBlue = do    let yesRed =  [1..33] \\ noRed    let yesBlue = [1..16] \\ noBlue    bracket (openFile ssqNum.txt WriteMode) (hClose) (\hd1 - pickSSQ count yesRed yesBlue hd1) It works

[Haskell-cafe] debugtracehelpers Re: traceM and traceShowM

2009-10-19 Thread Thomas Hartman
I have this and a couple other handy functions in DebugTraceHelpers: http://patch-tag.com/r/tphyahoo/DebugTraceHelpers/snapshot/current/content/pretty hackage: http://hackage.haskell.org/packages/archive/DebugTraceHelpers/0.12/doc/html/Debug-Trace-Helpers.html 2009/10/16 Martijn van

[Haskell-cafe] systemtimmetypeable: Workaround for lack of deriveable data instance in either System.Time or Data.Time.

2009-10-19 Thread Thomas Hartman
At http://osdir.com/ml/haskell-cafe@haskell.org/2009-10/msg00197.html I griped that the lack of Data-Derivable time values was causing me headache in happstack. In the proposed cabal package

Re: [Haskell-cafe] Hackage down

2009-10-19 Thread Sönke Hahn
On Monday 19 October 2009 10:30:55 am Dougal Stanton wrote: Has not been responding for at least the last 12 hours. Is there somewhere to look for status reports on sysadmin details like this, so we can tell if - it's a scheduled down time - it's a problem but the admins know about it -

[Haskell-cafe] ANNOUNCE: cereal-0.2

2009-10-19 Thread Trevor Elliott
Hello Everyone, cereal is a variation on the binary package that provides strict parsing, handleable exceptions with a named call stack, and a new parsing isolation feature. The major differences from binary are a new class called Serialize replacing the Binary class, getting and putting using

Re: [Haskell-cafe] Re: Documentation (was: ANN: text 0.5, a major revision of the Unicode text library)

2009-10-19 Thread Kyle Murphy
On a somewhat related note, I think the Haskell documentation in general is rather patchy and hard to follow for most things. Part of that I think is because of the confusion between the different forms of documentation. In general as a programmer I expect to find three kinds of documentation

Re: [Haskell-cafe] Re: Documentation (was: ANN: text 0.5, a major revision of the Unicode text library)

2009-10-19 Thread Tom Tobin
On Mon, Oct 19, 2009 at 4:32 PM, Kyle Murphy orc...@gmail.com wrote: If they have to spend three hours trying to track down some obscure research paper that's referenced in your documentation a half dozen times in as many functions, you're not providing enough detail and assuming too great a

[Haskell-cafe] Re: [Haskell-beginners] map question

2009-10-19 Thread Will Ness
wren ng thornton wren at freegeek.org writes: Will Ness wrote: (`foldl`2) works. (`-`2) should too. The `` syntax is for converting lexical identifiers into infix operators. Symbolic identifiers are already infix, which is why `` So it would be a no-op then. Why make it

Re: [Haskell-cafe] Re: [Haskell-beginners] map question

2009-10-19 Thread Tom Tobin
On Mon, Oct 19, 2009 at 5:34 PM, Will Ness will_...@yahoo.com wrote: This syntax already exists. The '`' symbol is non-collating already, so using it for symbol chars doesn't change anything (it's not that it can be a part of some name, right?). To turn an infix op into an infix op is an id

[Haskell-cafe] Re: [Haskell-beginners] map question

2009-10-19 Thread Will Ness
Tom Tobin korpios at korpios.com writes: On Mon, Oct 19, 2009 at 5:34 PM, Will Ness will_n48 at yahoo.com wrote: This syntax already exists. The '`' symbol is non-collating already, so using it for symbol chars doesn't change anything (it's not that it can be a part of some name,

Re: [Haskell-cafe] Re: [Haskell-beginners] map question

2009-10-19 Thread wren ng thornton
Will Ness wrote: wren ng thornton writes: Attack the underlying problem, don't introduce hacks to cover up broken hacks. This isn't C++. The underlying problem is a broken scanner where it can't distinguish between a binary op and a number read syntax. The underlying problem is that (1)

Re: [Haskell-cafe] Re: [Haskell-beginners] map question

2009-10-19 Thread Jason Dagit
On Mon, Oct 19, 2009 at 5:53 PM, Will Ness will_...@yahoo.com wrote: Tom Tobin korpios at korpios.com writes: On Mon, Oct 19, 2009 at 5:34 PM, Will Ness will_n48 at yahoo.com wrote: This syntax already exists. The '`' symbol is non-collating already, so using it for symbol chars

Re: [Haskell-cafe] Problems with Haskell

2009-10-19 Thread Keith Sheppard
Hello Philippos I received a lot of furious and offensive private emails for suggesting the Clean programmer to stick with Clean. I don't get why some people think it's OK to be disrespectful just because they're on the internet... Regarding the code, I find it hard to follow without some

Re: [Haskell-cafe] Re: [Haskell-beginners] map question

2009-10-19 Thread Luke Palmer
On Sun, Oct 18, 2009 at 5:31 PM, Will Ness will_...@yahoo.com wrote: Luke Palmer lrpalmer at gmail.com writes: Or you could use the subtract function.   map (subtract 2) [3,4,5]   [1,2,3] I don't want to. I think at about this point, this stopped being an intellectual discussion.