[Haskell-cafe] Re: Beginner SOS

2009-05-28 Thread Benjamin L . Russell
On Wed, 27 May 2009 15:04:36 -0700, Thomas DuBuisson thomas.dubuis...@gmail.com wrote: ?There are links to some great tutorials [1] and IRC information where you can get real-time help [2]. ?Also there are some good books [3]. I think most recent learners learned from YAHT [4], Gentle

Re: [Haskell-cafe] Design in Haskell?

2009-05-28 Thread Jason Dagit
Hi Dan, On Mon, May 25, 2009 at 1:22 AM, Dan danielkc...@gmail.com wrote: Hi, When I was learning to program in imperative languages like Java, there were plenty of resources to learn from about how to design large programs.   Ideas like the GoF Design Patterns gave useful models that one

[Haskell-cafe] Re: Who takes care of Haskell mailing lists?

2009-05-28 Thread Benjamin L . Russell
On Wed, 27 May 2009 17:52:17 -0300, Mauricio briqueabra...@yahoo.com wrote: I would like to create a mailing list for Portuguese speaking Haskell programmers. I tried checking haskell.org mailing lists page, but the only contact e-mail I see is 'mail...@haskell.org', and a message sent to that

RE: [Haskell-cafe] Template Haskell very wordy w/r/t Decs and Types

2009-05-28 Thread Simon Peyton-Jones
You already have splicing for top level decls. Splicing for local decls is a whole different ball game because it brings new *binders* into scope. For example f = ...g... g = let $(foo) in ...f... Is the 'f' inside 'g' the same 'f' as the one bound at top level? Not necessarily, because

Re: [Haskell-cafe] About the lazy pattern

2009-05-28 Thread Ketil Malde
张旭 stircrazyn...@hotmail.com writes: Hi, I am really new to haskell. I am reading A gentle instruction to haskell now. And I just cannot understand the chapter below. Is there anybody who can gives me some hints about why the pattern matching for client is so early? How does the pattern

RE: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-28 Thread Simon Peyton-Jones
You are absolutely right about the tantalising opportunity. I know that Lennart has thought quite a bit about this very point when designing his Paradise system. Likewise Conal for Pan. One difficulty is, I think, that it's easy to get ambiguity. Eg ifthenelse (a b) e1 e2 The (ab)

[Haskell-cafe] Re: We tried this functional, higher-order stuff with LISP and look what happened...

2009-05-28 Thread Benjamin L . Russell
On Wed, 27 May 2009 11:31:07 -0700, Jason Dusek jason.du...@gmail.com wrote: What can we say to that? I'm well practiced in handling those who reject types outright (Python programmers), those who reject what is too different (C programmers), those who can not live without objects (Java

RE: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-28 Thread Sittampalam, Ganesh
There are multiple possible classes that you might want under different circumstances (I think the most interesting issue is whether the class (==), () etc is in has a fundep from the type of the thing being compared to the type of the boolean), but if NoImplicitPrelude (or some other extension)

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-28 Thread Lennart Augustsson
Here's what I usually use. As Simon points out, ambiguity is lurking as soon as you use conditional. You can avoid it a fundep, but that's not necessarily what you want either. -- | Generalization of the 'Bool' type. Used by the generalized 'Eq' and 'Ord'. class Boolean bool where () ::

[Haskell-cafe] Re: What's the problem with iota's type signature?

2009-05-28 Thread Gracjan Polak
michael rice nowgate at yahoo.com writes: I've been digging into this stuff for months and it's still tripping me up. For exploration use GHCi. It can tell you the type of thing you have written. It has command to tell you type of thing, the :t. See here: Prelude let double x = Just (x + x)

Re: [Haskell-cafe] Re: Error message reform (was: Strange type error with associated type synonyms)

2009-05-28 Thread Claus Reinke
One user's view of error message history, perhaps helpful to reformers:-) Once upon a time, Hugs tended to have better error messages than GHC. They still weren't perfect, mostly when begginners where confronted with messages referring to advanced concepts - eg, Simon Thompson had a list of

Re: [Haskell-cafe] Lazy Parsing

2009-05-28 Thread Malcolm Wallace
Henning Thielemann schlepp...@henning-thielemann.de wrote: I don't think that it is in general possible to use the same parser for lazy and strict parsing, just because of the handling of parser failure. Polyparse demonstrates that you can mix-and-match lazy parsers with strict parsers in the

RE: [Haskell-cafe] Type class context propagation investigation[MESSAGE NOT SCANNED]

2009-05-28 Thread Paul Keir
Thanks. GHC at one stage suggested I add (Num a) = to my Num instance (after I'd added (Eq a) = to my Eq instance) and I didn't make the connection. -Original Message- From: Ryan Ingram [mailto:ryani.s...@gmail.com] Sent: Thu 28/05/2009 01:18 To: Paul Keir Cc: haskell-cafe@haskell.org

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-28 Thread Claus Reinke
Of course once you've got ifthenelse you find yourself wanting explicit desugaring of pattern matching (could view patterns help here?), Could you be more specific about what you want there, perhaps with a small example? I recognize the other problems from my own forays into EDSLs, but I'm not

Re: [Haskell-cafe] Re: What's the problem with iota's type signature?

2009-05-28 Thread Lee Duhem
On Thu, May 28, 2009 at 5:19 PM, Gracjan Polak gracjanpo...@gmail.com wrote: You don't have to guess then, Haskell compiler can do the guessing for you. It isn't guess, Haskell compiler (like GHC) gets these types by (type) inference, as you said :-) lee It is called type inference.

Re: [Haskell-cafe] the problem of design by negation

2009-05-28 Thread Magnus Therning
On Thu, May 28, 2009 at 5:59 AM, Conal Elliott co...@conal.net wrote: Thanks for bringing in this angle, David. My preference is for honest and humble practice and documentation of negative design.  Instead of saying that something won't work, can't work, is impossible etc (or rephrased via

Re: [Haskell-cafe] About the lazy pattern

2009-05-28 Thread Petr Pudlak
Hi Ryan, thanks for a nice and thorough explanation. I had trouble understanding the section of the tutorial as well. Maybe it would deserve to rewrite to something a bit simpler? Anyhow, I'd like to ask: Is there a reason for which pattern matching for single-constructor data types isn't lazy by

Re: [Haskell-cafe] About the lazy pattern

2009-05-28 Thread Max Bolingbroke
2009/5/28 Petr Pudlak d...@pudlak.name: Hi Ryan, thanks for a nice and thorough explanation. I had trouble understanding the section of the tutorial as well. Maybe it would deserve to rewrite to something a bit simpler? Anyhow, I'd like to ask: Is there a reason for which pattern matching for

Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-28 Thread Khudyakov Alexey
On Thursday 28 of May 2009 07:52:56 David Leimbach wrote: Sorry took so long to get back... Thank you for the response. Been really busy lately :-) There are also a lot of 9P implementations in many languages that you can interoperate with: http://9p.cat-v.org/implementations Thank you

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-28 Thread Sebastiaan Visser
Or overloading the `whitespace operator' for several kinds of application. On May 28, 2009, at 9:50 AM, Augustsson, Lennart wrote: And explicit desugaring of list syntax. -Original Message- From: Sittampalam, Ganesh [mailto:ganesh.sittampa...@credit- suisse.com] Sent: 28 May 2009

Re: [Haskell-cafe] Stack overflow

2009-05-28 Thread Bertram Felgenhauer
Krzysztof Skrzętnicki wrote: 2009/5/27 Bertram Felgenhauer bertram.felgenha...@googlemail.com: I wrote: Krzysztof Skrzętnicki wrote: The code for modifying the counter: (\ msg - atomicModifyIORef ioref (\ cnt - (cntMsg cnt msg,( atomicModifyIORef does not force the new value of

Re[2]: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-28 Thread Bulat Ziganshin
Hello Lennart, Thursday, May 28, 2009, 11:57:09 AM, you wrote: -- | Generalization of the 'Bool' type. Used by the generalized 'Eq' and 'Ord'. class Boolean bool where () :: bool - bool - bool -- ^Logical conjunction. (||) :: bool - bool - bool -- ^Logical disjunction. i

RE: [Haskell-cafe] Type class context propagation investigation

2009-05-28 Thread Paul Keir
Thanks Wren, that makes sense. Ryan Ingram wrote: Think of classes like data declarations; an instance with no context is a constant, and one with context is a function. Here's a simple translation of your code into data; this is very similar to the implementation used by GHC for

Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-28 Thread David Leimbach
On Thu, May 28, 2009 at 5:42 AM, Khudyakov Alexey alexey.sklad...@gmail.com wrote: On Thursday 28 of May 2009 07:52:56 David Leimbach wrote: Sorry took so long to get back... Thank you for the response. Been really busy lately :-) There are also a lot of 9P implementations in many

[Haskell-cafe] Re: Strange type error with associated type synonyms

2009-05-28 Thread Achim Schneider
Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Achim, Thursday, May 28, 2009, 1:34:55 AM, you wrote: Error: type of x is Integer while type of read argument should be String The problem with this is that the compiler can't know whether or not the type of arguments to

[Haskell-cafe] gtk2hs, TreeView and CellRenderer

2009-05-28 Thread Zefirov Sergey
As far as I can tell, there is not way to create CellRenderer that could include icons with the text (I think it is because of incompatibilities of Haskell type classes and Gtk inheritance hierarchy). Is it a good way to use CellRendererPixbuf and render to pixbufs using Cairo? I think my

Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-28 Thread Don Stewart
leimy2k: I'm also trying to figure out how bad/good Haskell Binary IO really is that it's been addressed a few times differently :-) FWIW Binary IO as implemented in Data.Binary is widely used in our production systems at Galois. I'd be fairly confident in it. -- Don

[Haskell-cafe] Re: Introducing Instances in GHC point releases

2009-05-28 Thread Simon Marlow
On 27/05/2009 22:02, Henning Thielemann wrote: My proposal is thus: Discourage orphan instances! If you encounter that an instance is missing and it is a canonical one, it should be added to the package that defines the type or the class. If there are several choices for the implementation then

Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-28 Thread John Van Enk
I'm trying to implement the protocol, so that I can implement other things on top of that. I'm also trying to figure out how bad/good Haskell Binary IO really is that it's been addressed a few times differently :-) FWIW, I've used Data.Binary extensively and have found it a joy to work

[Haskell-cafe] Re: Data.Binary and little endian encoding

2009-05-28 Thread David Leimbach
On Thursday, May 28, 2009, Don Stewart d...@galois.com wrote: leimy2k: I'm also trying to figure out how bad/good Haskell Binary IO really is that it's been addressed a few times differently :-) FWIW Binary IO as implemented in Data.Binary is widely used in our production systems at Galois.

Re: [Haskell-cafe] Re: Introducing Instances in GHC point releases

2009-05-28 Thread Henning Thielemann
On Thu, 28 May 2009, Simon Marlow wrote: Quite. I argued the no orphan instances in libraries position on the libraries list last year, here's the start of the (longish) thread: http://www.haskell.org/pipermail/libraries/2008-September/010618.html I remember. What I propose additionally

Re: [Haskell-cafe] Re: Data.Binary and little endian encoding

2009-05-28 Thread John Van Enk
Fair enough. I am just new to the interface, wondering if I should try matching responses by pulling apart via Get, or the bit syntax package. I'm assming you have some 'data Foo = ...'? If this is the case, you're probably okay writing an instance of Binary for Foo and using

[Haskell-cafe] Re: Error message reform (was: Strange type error with associated type synonyms)

2009-05-28 Thread Achim Schneider
John Dorsey hask...@colquitt.org wrote: As another native English speaker, I found expected/inferred very intuitive when I was new to GHC, and to Haskell. I even think that expected/inferred helped me form my intuition about Haskell's type inference. First off, me too, and I'm not a native

Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-28 Thread Duncan Coutts
On Thu, 2009-05-28 at 12:08 -0400, John Van Enk wrote: I'm trying to implement the protocol, so that I can implement other things on top of that. I'm also trying to figure out how bad/good Haskell Binary IO really is that it's been

Re: [Haskell-cafe] Re: Data.Binary and little endian encoding

2009-05-28 Thread David Leimbach
On Thu, May 28, 2009 at 9:17 AM, John Van Enk vane...@gmail.com wrote: Fair enough. I am just new to the interface, wondering if I should try matching responses by pulling apart via Get, or the bit syntax package. I'm assming you have some 'data Foo = ...'? If this is the case, you're

Re: [Haskell-cafe] Re: Data.Binary and little endian encoding

2009-05-28 Thread Don Stewart
leimy2k: encode/decode do Big Endian, and 9P does little endian. From the man page: Each message consists of a sequence of bytes. Two , four , and eight byte fields hold unsigned integers represented in little endian order (least significant byte first). encode/decode just won't work

Re: [Haskell-cafe] About the lazy pattern

2009-05-28 Thread Ryan Ingram
The main change I would make is to rename the arguments to client/server; they overload the same names (reqs/resps) as the top level declarations above, so it's very easy to get confused while reading it. Partially, I think this is just a hard concept to understand; struggling to figure it out

Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-28 Thread Johan Tibell
On Thu, May 28, 2009 at 6:34 PM, Duncan Coutts duncan.cou...@worc.ox.ac.ukwrote: If it's not available publicly perhaps you might share it privately. Don and I have discussed a few times writing a paper on the design and implementation of a binary library. I would definitely like to read

Re: [Haskell-cafe] Re: Data.Binary and little endian encoding

2009-05-28 Thread John Van Enk
Writing instances encode/decode that use either little endian or big endian (or mixed!) is trivial... see attached file. I don't see where your problem is... On Thu, May 28, 2009 at 12:35 PM, David Leimbach leim...@gmail.com wrote: On Thu, May 28, 2009 at 9:17 AM, John Van Enk

Re: [Haskell-cafe] Stack overflow

2009-05-28 Thread Krzysztof Skrzętnicki
On Thu, May 28, 2009 at 14:41, Bertram Felgenhauer bertram.felgenha...@googlemail.com wrote: Krzysztof Skrzętnicki wrote: 2009/5/27 Bertram Felgenhauer bertram.felgenha...@googlemail.com: I wrote: Krzysztof Skrzętnicki wrote: The code for modifying the counter: (\ msg - atomicModifyIORef

[Haskell-cafe] attaching a ghci session to another process

2009-05-28 Thread Kevin Smith
I am starting to get more involved with haskell programming and I'd like to create a program where I can use the interactive loop in ghci to run a haskell functions that create graphics in a separate openGL window. This would be a separate interactive window from the terminal i am running ghci in

[Haskell-cafe] Parsec float

2009-05-28 Thread Bartosz Wójcik
Hi Everybody (especially Parsec Creator), is there any reason why float parses only positive numbers? I find following defition: float = lexeme floating ? float floating= do{ n - decimal ; fractExponent n } If floating was

[Haskell-cafe] Parsec float

2009-05-28 Thread Malcolm Wallace
is there any reason why float parses only positive numbers? It is usual in parsing libraries to separate the recognition of a leading sign from recognition of the number itself: the sign-only parser can be reused in many contexts, e.g. in the Haskell'98 Numeric library, there is

[Haskell-cafe] ANNOUNCE: Hac φ: Haskell hackathon in Philadelphia, July 24-26

2009-05-28 Thread Brent Yorgey
Greetings, I am very pleased to officially announce Hac phi, a Haskell hackathon/get-together to be held July 24-26 at the University of Pennsylvania in Philadelphia. The hackathon will officially kick off at 2:30 Friday afternoon, and go until 5pm on Sunday (with breaks for sleep, of course).

[Haskell-cafe] Re: Error message reform (was: Strange type error with associated type synonyms)

2009-05-28 Thread Simon Michael
Achim Schneider wrote: expected/encountered Expected/actual ? Familiar to users of test frameworks. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Who takes care of Haskell mailing lists?

2009-05-28 Thread Maurí­cio
Benjamin, I would like to create a mailing list for Portuguese speaking Haskell programmers. (...) According to Mailing lists - HaskellWiki (see http://haskell.org/haskellwiki/Mailing_lists), Thanks for your comprehensive reports. However, I did took all measures you sugested. Any

[Haskell-cafe] Problem w/YAHT code example

2009-05-28 Thread michael rice
This code, from YAHT (Section 8.4.2, PDF pg. 119 of 192) seems to have a problem. Code below. Michael = [mich...@localhost ~]$ ghci GHCi, version 6.10.1: http://www.haskell.org/ghc/  :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking

Re: [Haskell-cafe] Problem w/YAHT code example

2009-05-28 Thread Andrew Wagner
I'm not sure what you're using at the end of the identifier search', but it needs to be the single quote that's on the same key as the double quotes. I suspect that's where it's blowing up. On Thu, May 28, 2009 at 9:56 PM, michael rice nowg...@yahoo.com wrote: This code, from YAHT (Section

Re: [Haskell-cafe] Re: Data.Binary and little endian encoding

2009-05-28 Thread David Leimbach
On Thu, May 28, 2009 at 11:39 AM, John Van Enk vane...@gmail.com wrote: Writing instances encode/decode that use either little endian or big endian (or mixed!) is trivial... see attached file. I don't see where your problem is... Inexperience, lack of enough contiguous time to digest

Re: [Haskell-cafe] What's the problem with iota's type signature?

2009-05-28 Thread wren ng thornton
michael rice wrote: Yeah, I went back and tried double again, though I'd swear I got the dang thing to compile (and run) w/o errors. I guess I meant Num. So Num is a class and Int and Integer are types? What are the other classes? Docs? Unification, for me, is pattern matching ala Prolog.

Re: [Haskell-cafe] Re: We tried this functional, higher-order stuff with LISP and look what happened...

2009-05-28 Thread Jason Dusek
2009/05/28 Benjamin L.Russell dekudekup...@yahoo.com: What makes you think that Haskell is likely eventually to dig a smoking hole in the ground? This is more about unmet expectations than spectacular failure. -- Jason Dusek ___ Haskell-Cafe

Re: [Haskell-cafe] Re: Error message reform

2009-05-28 Thread wren ng thornton
Claus Reinke wrote: Still, I would really like a just the facts, please mode for GHC, with less text and more type signatures (especially for the contexts of type mismatches). Error messages simply not including the information I need has become my main issue with GHC messages, and seems to be

Re: [Haskell-cafe] Problem w/YAHT code example

2009-05-28 Thread michael rice
Thanks! I just copied the code from the PDF file. Whatever that character was it wasn't the correct one. Michael --- On Thu, 5/28/09, Andrew Wagner wagner.and...@gmail.com wrote: From: Andrew Wagner wagner.and...@gmail.com Subject: Re: [Haskell-cafe] Problem w/YAHT code example To: michael

Re: [Haskell-cafe] What's the problem with iota's type signature?

2009-05-28 Thread michael rice
And I thought everyone was puzzling these type signatures out all by themselves. ;-) The Haskell learning curve is about the steepest I've ever seen for a computer language, but I think I'm catching on. Thanks for the info. Michael --- On Thu, 5/28/09, wren ng thornton w...@freegeek.org