[Haskell-cafe] Operator cheat sheet, and monadic style q

2008-11-22 Thread Owen Smith
Greetings, I'm a longtime Haskell-curious programmer who, after a few aborted attempts at getting started and long nights staring at academic papers, finally managed to get the bug. I've been pleased with my progress so far, but a couple of things have bugged me enough to seek advice from the

Re: [Haskell-cafe] Operator cheat sheet, and monadic style q

2008-11-22 Thread Andrew Coppin
Owen Smith wrote: 1. Contending with the use of frequently unfamiliar non-alphanumeric operators has been an uphill battle for me. I think the main reason for this is that I've had no luck in Googling up their definitions (my primary approach for dealing with every other unknown in the Haskell

Re: [Haskell-cafe] Operator cheat sheet, and monadic style q

2008-11-22 Thread Max Rabkin
On Sat, Nov 22, 2008 at 11:31 AM, Owen Smith [EMAIL PROTECTED] wrote: I'm a longtime Haskell-curious programmer who, after a few aborted attempts at getting started and long nights staring at academic papers, finally managed to get the bug. I've been pleased with my progress so far, but a

Re: [Haskell-cafe] Operator cheat sheet, and monadic style q

2008-11-22 Thread Luke Palmer
On Sat, Nov 22, 2008 at 2:31 AM, Owen Smith [EMAIL PROTECTED] wrote: 2. There's a lot I need to learn about good Haskell style, especially coming from a C++ background. Even my experience in Lisp seems to result in way more parentheses than Haskell coders are comfortable with. :-) In

[Haskell-cafe] Re: [Haskell] Does GHC support the standard CPP functionalities?

2008-11-22 Thread Malcolm Wallace
[moved to haskell-cafe] {-# LANGUAGE CPP #-} module Packer where #define FLASH_APP_START 1 #define FLASH_APP_END2 #define INSERT_SECTION(x) (#x, (FLASH_##x##_START, FLASH_##x##_END)) The CPP stringization operator # and the token-catenation operator ## are ANSI additions over the

Re: [Haskell-cafe] Extensible Exceptions

2008-11-22 Thread Thomas Schilling
Be careful, though. This only works if there's a single constructor for your exception type. If there are multiple, you should write it like this: thing_to_try `catch` \(e :: MyErrorType) - case e of MyError1 _ - ..; MyError2 _ - ... If you write `catch` (MyError1 ...) and a MyError2 is

[Haskell-cafe] How to use Unicode strings?

2008-11-22 Thread Dmitri O.Kondratiev
Please advise how to write Unicode string, so this example would work: main = do putStrLn Les signes orthographiques inclus les accents (aigus, grâve, circonflexe), le tréma, l'apostrophe, la cédille, le trait d'union et la majuscule. I get the following error: hello.hs:4:68: lexical error

Re: [Haskell-cafe] How to use Unicode strings?

2008-11-22 Thread Luke Palmer
2008/11/22 Dmitri O.Kondratiev [EMAIL PROTECTED]: Please advise how to write Unicode string, so this example would work: main = do putStrLn Les signes orthographiques inclus les accents (aigus, grâve, circonflexe), le tréma, l'apostrophe, la cédille, le trait d'union et la majuscule. That

Re: [Haskell-cafe] Fixity parsing, Template Haskell

2008-11-22 Thread Niklas Broberg
Of course, this would require a change to Template Haskell, so a second-best solution would be to forbid unparenthesised expressions in my quasiquoter. Then, parsing can proceed correctly without knowing the fixities. This would be easiest to do if haskell-src-exts changed its AST in a

Re: [Haskell-cafe] Re: Type question in instance of a class

2008-11-22 Thread Janis Voigtlaender
Peter Hercek wrote: But Haskell with Control.Exception extension has more values of all types since they can be thrown and later caught and investigated at that place. Maybe the last sentence of section 2.1 (_|_ Bottom) of Haskell/Denotational semantics should be clarified better.

Re: [Haskell-cafe] implementing python-style dictionary in Haskell

2008-11-22 Thread Janis Voigtlaender
Ryan Ingram wrote: On Tue, Nov 18, 2008 at 12:46 PM, Luke Palmer [EMAIL PROTECTED] wrote: But when these persistent data structures are used in a single-threaded way, why should we not hope for the performance to be comparable? If you can guarantee single-threaded use, then you can just use

Re: [Haskell-cafe] How to use Unicode strings?

2008-11-22 Thread Austin Seipp
Excerpts from Dmitri O.Kondratiev's message of Sat Nov 22 05:40:41 -0600 2008: Please advise how to write Unicode string, so this example would work: main = do putStrLn Les signes orthographiques inclus les accents (aigus, grâve, circonflexe), le tréma, l'apostrophe, la cédille, le trait

Re: [Haskell-cafe] Do I need an account to report build of Hacakge packages?

2008-11-22 Thread Duncan Coutts
On Fri, 2008-11-21 at 16:12 -0800, Ahn, Ki Yung wrote: I am just curious about how cabal report works. I recently figured out that there is a report command in cabal and it reports the reports generated by --build-reports option when building a package. Is this because I don't have an

Re: [Haskell-cafe] varargs zip

2008-11-22 Thread Janis Voigtlaender
Sean Leather wrote: EMGM [1] has a generic zipWith [2]: zipWith :: FRep3 ZipWith f = (a - b - c) - f a - f b - Maybe (f c) This is generic according to the container type 'f'. A particular specialization of this is zip: zip :: FRep3 ZipWith f = f a - f b - Maybe (f (a, b)) Also,

Re: [Haskell-cafe] How to use Unicode strings?

2008-11-22 Thread Janis Voigtlaender
Alexey Khudyakov wrote: putStrLn Ну и где этот ваш хвалёный уникод? :-) -- Dr. Janis Voigtlaender http://wwwtcs.inf.tu-dresden.de/~voigt/ mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Extensible Exceptions

2008-11-22 Thread David F. Place
On Sat, 2008-11-22 at 11:33 +, Thomas Schilling wrote: Be careful, though. This only works if there's a single constructor for your exception type. If there are multiple, you should write it like this: thing_to_try `catch` \(e :: MyErrorType) - case e of MyError1 _ - ..; MyError2 _ -

Re: [Haskell-cafe] Do I need an account to report build of Hacakgepackages?

2008-11-22 Thread Claus Reinke
You only need an account for uploading packages. If you do not want to have to enter your user name or password interactively when you run cabal upload then you can put them in the config file: username: password: That sounds like a very bad idea, and should not be encouraged! Any compromised

Re: [Haskell-cafe] Do I need an account to report build of Hacakgepackages?

2008-11-22 Thread Duncan Coutts
On Sat, 2008-11-22 at 15:11 +, Claus Reinke wrote: You only need an account for uploading packages. If you do not want to have to enter your user name or password interactively when you run cabal upload then you can put them in the config file: username: password: That sounds

Re: [Haskell-cafe] Extensible Exceptions

2008-11-22 Thread Thomas Schilling
2008/11/22 David F. Place [EMAIL PROTECTED]: On Sat, 2008-11-22 at 11:33 +, Thomas Schilling wrote: Be careful, though. This only works if there's a single constructor for your exception type. If there are multiple, you should write it like this: thing_to_try `catch` \(e ::

Re: [Haskell-cafe] Do I need an account to report build of Hacakgepackages?

2008-11-22 Thread Antti-Juhani Kaijanaho
On Sat, Nov 22, 2008 at 03:11:34PM -, Claus Reinke wrote: You only need an account for uploading packages. If you do not want to have to enter your user name or password interactively when you run cabal upload then you can put them in the config file: username: password: That sounds

Re: [Haskell-cafe] Extensible Exceptions

2008-11-22 Thread David F. Place
On Sat, 2008-11-22 at 15:27 +, Thomas Schilling wrote: *Main tryJust errorCalls $ print $ [] !! 23 tryJust errorCalls $ print $ [] !! 23^JLeft Prelude.(!!): index too large *Main tryJust errorCalls $ print $ throw NonTermination tryJust

Re: [Haskell-cafe] Fixity parsing, Template Haskell

2008-11-22 Thread Reiner Pope
It seems to me that fixity information behaves more like semantics than like syntax. For instance, fixities may be imported, and obey namespacing rules. Knowing and correctly handling these rules seems beyond the scope of a mere parser: I would hope that a single Haskell file could be parsed

Re: [Haskell-cafe] Do I need an account to report build ofHacakgepackages?

2008-11-22 Thread Claus Reinke
Any compromised uploader machine with stored passwords can be used to upload compromising code, which will propagate to all downloaders. It doesn't really matter whether a compromised machine stores a password or not. If you upload anything using a compromised machine, the attacker has the

Re: [Haskell-cafe] How to use Unicode strings?

2008-11-22 Thread Don Stewart
alexey.skladnoy: That really ought to work. Is the file encoded in UTF-8 (rather than, eg. latin-1)? This should pretend to work. Simple print functions garble unicode characters. For example : putStrLn Ну и где этот ваш хвалёный уникод? prints following output C 8 345 MBB 20H

Re: [Haskell-cafe] implementing python-style dictionary in Haskell

2008-11-22 Thread Ryan Ingram
On Sat, Nov 22, 2008 at 5:33 AM, Janis Voigtlaender [EMAIL PROTECTED] wrote: You can generally make a persistent data structure with the same asymptotic bounds as the ephemeral structure, ... I would be very careful with the generally here. At least, I am not aware that this has been proved

Re: [Haskell-cafe] How to use Unicode strings?

2008-11-22 Thread Duncan Coutts
On Sat, 2008-11-22 at 10:02 -0800, Don Stewart wrote: Use the UTF8 printing functions, import qualified System.IO.UTF8 as U main = U.putStrLn Ну и где этот ваш хвалёный уникод? Running this, *Main main Ну и где этот ваш хвалёный уникод? This upsets me. We need to

[Haskell-cafe] GHC 6.10 and OpenGL

2008-11-22 Thread Paul L
Hi everyone, It's sad to see the OpenGL binding being dropped from GHC binary installers starting from 6.10. Though this issue has been brought up and discussed before, I'm sure a lot of people who based their work on OpenGL would share the same sympathy. I'm not here to argue whether this

[Haskell-cafe] Re: [Haskell] GHC 6.10 and OpenGL

2008-11-22 Thread Don Stewart
ninegua: Hi everyone, It's sad to see the OpenGL binding being dropped from GHC binary installers starting from 6.10. Though this issue has been brought up and discussed before, I'm sure a lot of people who based their work on OpenGL would share the same sympathy. $ cabal install

Re: [Haskell-cafe] Extensible Exceptions

2008-11-22 Thread Henning Thielemann
On Sat, 22 Nov 2008, Thomas Schilling wrote: Be careful, though. This only works if there's a single constructor for your exception type. If there are multiple, you should write it like this: thing_to_try `catch` \(e :: MyErrorType) - case e of MyError1 _ - ..; MyError2 _ - ... If you

Re: [Haskell-cafe] Re: [Haskell] GHC 6.10 and OpenGL

2008-11-22 Thread Greg Fitzgerald
$ cabal install OpenGL HOpenGL installs easily with cabal-install, but most HOpenGL examples and tutorials also use GLUT, which is not so painless on Windows. Luckily Conal Elliot just recently posted detailed instructions of how to do it:

Re: [Haskell-cafe] Re: [Haskell] GHC 6.10 and OpenGL

2008-11-22 Thread Jeff Heard
I'm not sure.. can MSVC compiled libraries be intermixed with mingwin libraries? I see Conal has advised installing mingwin as part of his GLUT packaging. -- Jeff On Sat, Nov 22, 2008 at 7:06 PM, Greg Fitzgerald [EMAIL PROTECTED] wrote: $ cabal install OpenGL HOpenGL installs easily

Re: [Haskell-cafe] Extensible Exceptions

2008-11-22 Thread Henning Thielemann
On Sat, 22 Nov 2008, Thomas Schilling wrote: It's a pattern match error, implemented by throwing an asynchronous exception. The idea being, that we only have one mechanism (well, an synchronous exceptions, thrown via throwIO). Yes, I know that there's a difference between error and

Re: [Haskell-cafe] Re: [Haskell] GHC 6.10 and OpenGL

2008-11-22 Thread Conal Elliott
That post is by David Sankel (camior on #haskell), not by me. My last name has two ts. Good luck, - Conal (Elliott) On Sat, Nov 22, 2008 at 4:06 PM, Greg Fitzgerald [EMAIL PROTECTED] wrote: $ cabal install OpenGL HOpenGL installs easily with cabal-install, but most HOpenGL examples

Re: [Haskell-cafe] Extensible Exceptions

2008-11-22 Thread Duncan Coutts
On Sun, 2008-11-23 at 01:40 +0100, Henning Thielemann wrote: On Sat, 22 Nov 2008, Thomas Schilling wrote: It's a pattern match error, implemented by throwing an asynchronous exception. The idea being, that we only have one mechanism (well, an synchronous exceptions, thrown via throwIO).

[Haskell-cafe] Re: [Haskell] GHC 6.10 and OpenGL

2008-11-22 Thread Paul L
On 11/22/08, Don Stewart [EMAIL PROTECTED] wrote: ninegua: Hi everyone, It's sad to see the OpenGL binding being dropped from GHC binary installers starting from 6.10. Though this issue has been brought up and discussed before, I'm sure a lot of people who based their work on OpenGL would

Re: [Haskell-cafe] implementing python-style dictionary in Haskell

2008-11-22 Thread Janis Voigtlaender
Ryan Ingram wrote: On Sat, Nov 22, 2008 at 5:33 AM, Janis Voigtlaender [EMAIL PROTECTED] wrote: You can generally make a persistent data structure with the same asymptotic bounds as the ephemeral structure, ... I would be very careful with the generally here. At least, I am not aware that

Re: [Haskell-cafe] How to use Unicode strings?

2008-11-22 Thread Alexey Khudyakov
This upsets me. We need to get on with doing this properly. The System.IO.UTF8 module is a useful interim workaround but we're not using it properly most of the time. ... skipped ... The right thing to do is to make Prelude.putStrLn do the right thing. We had a long discussion on how to

Re: [Haskell-cafe] How to use Unicode strings?

2008-11-22 Thread Don Stewart
alexey.skladnoy: This upsets me. We need to get on with doing this properly. The System.IO.UTF8 module is a useful interim workaround but we're not using it properly most of the time. ... skipped ... The right thing to do is to make Prelude.putStrLn do the right thing. We had a

Re: [Haskell-cafe] implementing python-style dictionary in Haskell

2008-11-22 Thread Ryan Ingram
On Sat, Nov 22, 2008 at 1:20 PM, Jason Dusek [EMAIL PROTECTED] wrote: Ryan Ingram [EMAIL PROTECTED] wrote: ...persistent data structures tend to have much worse constant factors and those factors translate to a general 2x-3x slowdown. Can you explain why that is, or provide a citation for

Re: [Haskell-cafe] Re: Type question in instance of a class

2008-11-22 Thread Janis Voigtlaender
Henning Thielemann wrote: On Sat, 22 Nov 2008, Janis Voigtlaender wrote: Definitely. And that surfaces even in quite innocently looking programs and statements about them. The introductory example of the following technical report may be amusing in that respect: