[Haskell-cafe] Re: Just for a laugh...

2007-06-01 Thread Jon Fairbairn
Dougal Stanton [EMAIL PROTECTED] writes: On 31 May 2007 21:52:33 +0100, Jon Fairbairn [EMAIL PROTECTED] wrote: Yes, but you didn't say that it's not only silly but demonstrates the opposite of expressiveness as it's all about breaking an abstraction and must be non-portable code

[Haskell-cafe] how do I pass customization items in syb code?

2007-06-01 Thread Alex Jacobson
I'm looking at the XML SYB example http://www.cs.vu.nl/boilerplate/testsuite/xmlish/Main.hs I'd like to find a way to pass other type customizations as arguments to data2content and content2data. I modified data2Content as follows: data2content f = element

Re: [Haskell-cafe] Just for a laugh...

2007-06-01 Thread Bulat Ziganshin
Hello Andrew, Thursday, May 31, 2007, 11:47:28 PM, you wrote: (Otherwise... wasn't there some library somewhere for serialising values in binary?) Binary, AltBinary (see latest HCAR), just an example using AltBinary: main = do let s = encode (1.1::Float) -- s has type String

Re: [Haskell-cafe] Just for a laugh...

2007-06-01 Thread Jules Bean
Donald Bruce Stewart wrote: let s = encode (1.1 :: Float) :t s s :: Data.ByteString.Lazy.ByteString s LPS [\NUL\NUL\140\204\205\255\255\255\255\255\255\255\233] decode s :: Float 1.1 But doesn't Data.Binary serialise to a guaranteed representation, i.e.

Re: [Haskell-cafe] RE: [Haskell] boilerplate boilerplate

2007-06-01 Thread Claus Reinke
Actually, standalone deriving doesn't really solve the boilerplate boilerplate problem. My original complaint here is that I don't want to explicitly declare a deriving (Data,Typeable) for every type used somewhere inside a larger type I am using. In this particular case, I am using SYB to

Re: [Haskell-cafe] Just for a laugh...

2007-06-01 Thread Donald Bruce Stewart
bulat.ziganshin: Hello Andrew, Thursday, May 31, 2007, 11:47:28 PM, you wrote: (Otherwise... wasn't there some library somewhere for serialising values in binary?) Binary, AltBinary (see latest HCAR), just an example using AltBinary: main = do let s = encode (1.1::Float)

Re: [Haskell-cafe] Just for a laugh...

2007-06-01 Thread Donald Bruce Stewart
jules: Donald Bruce Stewart wrote: let s = encode (1.1 :: Float) :t s s :: Data.ByteString.Lazy.ByteString s LPS [\NUL\NUL\140\204\205\255\255\255\255\255\255\255\233] decode s :: Float 1.1 But doesn't Data.Binary serialise to a guaranteed

Re: [Haskell-cafe] RE: [Haskell] boilerplate boilerplate

2007-06-01 Thread Alex Jacobson
Claus Reinke wrote: Actually, standalone deriving doesn't really solve the boilerplate boilerplate problem. My original complaint here is that I don't want to explicitly declare a deriving (Data,Typeable) for every type used somewhere inside a larger type I am using. In this particular case,

[Haskell-cafe] Re: What puts False before True?

2007-06-01 Thread Stephane Bortzmeyer
On Fri, Jun 01, 2007 at 03:33:41AM +0100, PR Stanley [EMAIL PROTECTED] wrote a message of 19 lines which said: The question, however, still remains: why False = 0 and True 1? Arbitrary decision? On a similar case, the ISO 5218 standard, representation of human gender

Re: [Haskell-cafe] What puts False before True?

2007-06-01 Thread Henning Thielemann
On Thu, 31 May 2007, Paul Hudak wrote: PR Stanley wrote: I think so, too. In Boolean algebra (which predates computers, much less C), FALSE has traditionally been associated with 0, and TRUE with 1. And since 1 0, TRUE FALSE. The question, however, still remains: why False = 0 and

Re: [Haskell-cafe] RE: [Haskell] boilerplate boilerplate

2007-06-01 Thread Neil Mitchell
Hi Alex, The problem with Data.Derive is that I now have a pre-processor cycle as part of my build process. Automatic and universal Data and Typeable instance deriving should just be built into Haskell. Not if you use the template haskell support. We don't currently have a deriveAll command,

Re[2]: [Haskell-cafe] Just for a laugh...

2007-06-01 Thread Bulat Ziganshin
Hello Jules, Friday, June 1, 2007, 3:02:33 PM, you wrote: machine-independent? Whereas this (stupid) question explicitly asked for *your particular hardware's* floating point rep. there is castSTUArray function which is widely used exactly for this purpose. look for examples of its usage in

Re: [Haskell-cafe] RE: [Haskell] boilerplate boilerplate

2007-06-01 Thread Alex Jacobson
I suppose a deriveAll command from template haskell would work. Is that really possible? -Alex- Neil Mitchell wrote: Hi Alex, The problem with Data.Derive is that I now have a pre-processor cycle as part of my build process. Automatic and universal Data and Typeable instance deriving should

Re: [Haskell-cafe] Implementing Mathematica

2007-06-01 Thread Jacques Carette
Andrew Coppin wrote: Lennart Augustsson wrote: Why do you seem so in awe of Mathematica? Oh, well, I guess it is only the most powerful maths software ever written... no biggie. No, it is one of several. In very little time I can find 20 things that Maple does better than Mathematica. In

Re: [Haskell-cafe] What puts False before True?

2007-06-01 Thread Derek Elkins
Henning Thielemann wrote: On Thu, 31 May 2007, Paul Hudak wrote: PR Stanley wrote: I think so, too. In Boolean algebra (which predates computers, much less C), FALSE has traditionally been associated with 0, and TRUE with 1. And since 1 0, TRUE FALSE. The question, however, still remains:

Re: [Haskell-cafe] New (?) Partial Monad

2007-06-01 Thread Justin Bailey
Can you post any code using the monad? The article was interesting but I think it would make more sense if I saw some working code ... Justin ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Implementing Mathematica

2007-06-01 Thread Andrew Coppin
[EMAIL PROTECTED] wrote: Andrew Coppin cites me and asks: I find that statement interesting. I have never come across *any* other package that can perform _symbolic_ mathematics. (Sure, there are packages that can perform specific operations - solving certain kinds of equations, transforming

Re: [Haskell-cafe] Just for a laugh...

2007-06-01 Thread Andrew Coppin
David Roundy wrote: Note also that you can use unsafePerformIO to safely get pure functions doing both these operations. I've always been puzzled by this one... how does unsafePerformIO circumvent the type system? I don't understand. ___

Re: [Haskell-cafe] What puts False before True?

2007-06-01 Thread Albert Y. C. Lai
PR Stanley wrote: The question, however, still remains: why False = 0 and True 1? I appreciate that it's so in boolean algebra but why? Why not True = 0 and False = 1? A Boolean value denotees veracity whereas an ordered value concerns magnitude (priority), indeed, order!! Other members have

Re: [Haskell-cafe] Implementing Mathematica

2007-06-01 Thread Andrew Coppin
[EMAIL PROTECTED] wrote: PS. Somebody (A. Coppin?) said that Mathematica not without reason costs 1. Welll, less than 2000, and for students there are much cheaper possibi- lities. I am the last to make free ads for Wolfram, I recommend the usage of Axiom and Maxima to my students, but

Re: [Haskell-cafe] Just for a laugh...

2007-06-01 Thread David Roundy
On Fri, Jun 01, 2007 at 07:28:07PM +0100, Andrew Coppin wrote: David Roundy wrote: Note also that you can use unsafePerformIO to safely get pure functions doing both these operations. I've always been puzzled by this one... how does unsafePerformIO circumvent the type system? I don't

Re: [Haskell-cafe] Just for a laugh...

2007-06-01 Thread Andrew Coppin
Donald Bruce Stewart wrote: See also the older NewBinary, http://hackage.haskell.org/cgi-bin/hackage-scripts/package/NewBinary-0.1 Now that's just ironic... Incidentally, I've been thinking. You *might* want the binary representation of things if you were going to, say, compress or

Re: [Haskell-cafe] Just for a laugh...

2007-06-01 Thread Andrew Coppin
David Roundy wrote: On Fri, Jun 01, 2007 at 07:28:07PM +0100, Andrew Coppin wrote: David Roundy wrote: Note also that you can use unsafePerformIO to safely get pure functions doing both these operations. I've always been puzzled by this one... how does unsafePerformIO

Re: [Haskell-cafe] Implementing Mathematica

2007-06-01 Thread Andrew Coppin
Jacques Carette wrote: Andrew Coppin wrote: Lennart Augustsson wrote: Why do you seem so in awe of Mathematica? Oh, well, I guess it is only the most powerful maths software ever written... no biggie. No, it is one of several. In very little time I can find 20 things that Maple does

Re: [Haskell-cafe] Just for a laugh...

2007-06-01 Thread David Roundy
On Fri, Jun 01, 2007 at 07:39:32PM +0100, Andrew Coppin wrote: David Roundy wrote: On Fri, Jun 01, 2007 at 07:28:07PM +0100, Andrew Coppin wrote: David Roundy wrote: Note also that you can use unsafePerformIO to safely get pure functions doing both these operations. I've

[Haskell-cafe] Hardware

2007-06-01 Thread Andrew Coppin
OK, so... If you were going to forget everything we humans know about digital computer design - the von Neuman architecture, the fetch/decode/execute loop, the whole shooting match - and design a computer *explicitly* for the purpose of executing Haskell programs... what would it look like?

Re: [Haskell-cafe] Just for a laugh...

2007-06-01 Thread Dan Doel
On Friday 01 June 2007, Andrew Coppin wrote: David Roundy wrote: Note also that you can use unsafePerformIO to safely get pure functions doing both these operations. I've always been puzzled by this one... how does unsafePerformIO circumvent the type system? I don't understand. import

Re: [Haskell-cafe] Existentials and type var escaping

2007-06-01 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David House wrote: On 31/05/07, Isaac Dupree [EMAIL PROTECTED] wrote: foo undefined = undefined That's not true. When you evaluate foo undefined, it matches the first (irrefutable) pattern immediately, without any deconstruction of the

Re: [Haskell-cafe] Just for a laugh...

2007-06-01 Thread rossberg
David Roundy wrote: On Fri, Jun 01, 2007 at 07:39:32PM +0100, Andrew Coppin wrote: No, I mean... how could you use unsafePerformIO to perform a typecast? I don't see a way to do that. Then I'm confused. What typecast are you talking about? cast :: a - b cast x = unsafePerformIO (do

Re: [Haskell-cafe] Hardware

2007-06-01 Thread Jeremy Shaw
Hello, Did you see the recently announce reduceron project? (Or perhaps you are already involved in that project?) http://www-users.cs.york.ac.uk/~mfn/reduceron/index.html If you search scholar.google.com for graph reduction machine you should turn up a bunch of papers about attempts to build a

Re: [Haskell-cafe] What puts False before True?

2007-06-01 Thread Tomasz Zielonka
On Thu, May 31, 2007 at 04:52:57AM +0100, PR Stanley wrote: What justifies False True? This way we have only one person asking such question. If it was done the other way, there would be hundreds... ;-) BTW, your question provoked an interesting discussion and generated some nice answers (I

[Haskell-cafe] Re: Hardware

2007-06-01 Thread Jon Fairbairn
Andrew Coppin [EMAIL PROTECTED] writes: OK, so... If you were going to forget everything we humans know about digital computer design - the von Neuman architecture, the fetch/decode/execute loop, the whole shooting match - and design a computer *explicitly* for the purpose of executing

Re: [Haskell-cafe] Implementing Mathematica

2007-06-01 Thread Chaddaï Fouché
-- Forwarded message -- From: Chaddaï Fouché [EMAIL PROTECTED] Date: 2 juin 2007 00:00 Subject: Re: [Haskell-cafe] Implementing Mathematica To: Andrew Coppin [EMAIL PROTECTED] 2007/6/1, Andrew Coppin [EMAIL PROTECTED]: I looked, I didn't find anything interesting. Well maybe

Re: [Haskell-cafe] What puts False before True?

2007-06-01 Thread PR Stanley
P.S.: The question, however, still remains: why False = 0 and True 1? I appreciate that it's so in boolean algebra but why? Why not True = 0 and False = 1? A Boolean value denotees veracity whereas an ordered value concerns magnitude (priority), indeed, order!! Other members have mentioned

Re: [Haskell-cafe] Re: Hardware

2007-06-01 Thread Claus Reinke
either be slower than mainstream hardware or would be overtaken by it in a very short space of time. i'd like to underline the last of these two points, and i'm impressed that you came to that conclusion as early as the eighties. i'm not into hardware research myself, but while i was

Re: [Haskell-cafe] Implementing Mathematica

2007-06-01 Thread Dan Piponi
On 6/1/07, Chaddaï Fouché [EMAIL PROTECTED] wrote: 2007/6/1, Andrew Coppin [EMAIL PROTECTED]: I looked, I didn't find anything interesting. Well maybe you should look one more time with your brain on... Even my years old TI-89 calculator with a paltry Z80 processor and a few hundred K of RAM

Re: [Haskell-cafe] OpenGL

2007-06-01 Thread Dan Piponi
Jon asked: Where should I go to get started with OpenGL and Haskell? Don't use the examples here: http://www.haskell.org/HOpenGL/ They don't work with recent versions of HOpenGL. But do use the examples here: http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/libraries/GLUT/examples/RedBook/

[Haskell-cafe] Re: Resolved: ffi linking problem

2007-06-01 Thread jeff p
Hello, If -fvia-C fixes your problem, then your code has a bug, strictly speaking. If your foreign call requires some information from a header file, then the right way to call it is by making a small C wrapper function and calling that. I tried to do this but couldn't. I could get GHC to

Re: [Haskell-cafe] Re: Resolved: ffi linking problem

2007-06-01 Thread Stefan O'Rear
On Fri, Jun 01, 2007 at 10:10:53PM -0400, jeff p wrote: Hello, If -fvia-C fixes your problem, then your code has a bug, strictly speaking. If your foreign call requires some information from a header file, then the right way to call it is by making a small C wrapper function and calling

Re: [Haskell-cafe] Just for a laugh...

2007-06-01 Thread Donald Bruce Stewart
andrewcoppin: Donald Bruce Stewart wrote: See also the older NewBinary, http://hackage.haskell.org/cgi-bin/hackage-scripts/package/NewBinary-0.1 Now that's just ironic... Incidentally, I've been thinking. You *might* want the binary representation of things if you were going

Re: [Haskell-cafe] Re: Resolved: ffi linking problem

2007-06-01 Thread jeff p
Hello, No, it sounds like you're using the wrong import syntax. That linker warning is a dead givaway you should be using ccall, not stdcall. Ok. I just tried changing this and now things work fairly well. I thought stdcall was the correct syntax for windows. This seems like a strange state

Re: [Haskell-cafe] Re: Resolved: ffi linking problem

2007-06-01 Thread Stefan O'Rear
On Fri, Jun 01, 2007 at 10:48:12PM -0400, jeff p wrote: Hello, No, it sounds like you're using the wrong import syntax. That linker warning is a dead givaway you should be using ccall, not stdcall. Ok. I just tried changing this and now things work fairly well. I thought stdcall was

Re: [Haskell-cafe] OpenGL

2007-06-01 Thread Jon Harrop
On Saturday 02 June 2007 02:45:48 Dan Piponi wrote: But do use the examples here: http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/libraries/GLUT/examples/R edBook/ They worked for me. Great, thanks. May I just ask, does ShadowMap.hs work on your machine? -- Dr Jon D Harrop, Flying Frog