Re: [Haskell-cafe] Re: Data.Binary Endianness

2007-09-11 Thread Sven Panne
On Monday 10 September 2007 21:02, apfelmus wrote: [...] class Put a endian where put :: endian - a - Put [...] Oh, and the 8,16,32 and 64 are good candidates for phantom type/associated data types, too. I think that using any non-H98 feature like MPTC or associated data types for

Re: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Sven Panne
On Monday 10 September 2007 19:50, Thomas Schilling wrote: [...] instance Binary MP3 where get = MP3 $ getHeader * getData -- [*] where getHeader = do magic - getWord32le case magic of ... Of course this works in the sense that it

Re: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Don Stewart
sven.panne: On Monday 10 September 2007 19:50, Thomas Schilling wrote: [...] instance Binary MP3 where get = MP3 $ getHeader * getData -- [*] where getHeader = do magic - getWord32le case magic of ... Of course this works in the

Re: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Sven Panne
On Tuesday 11 September 2007 08:14, Don Stewart wrote: sven.panne: On Monday 10 September 2007 19:50, Thomas Schilling wrote: [...] instance Binary MP3 where get = MP3 $ getHeader * getData -- [*] where getHeader = do magic - getWord32le case magic of

Re: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Sven Panne
On Monday 10 September 2007 19:26, Don Stewart wrote: Yep, just send a patch. Or suggest what needs to happen. OK, I'll see what I can do next weekend, currently I'm busy with packaging/fixing GHC. I have similar code lying around in various places, and it would be nice if there was a more

Re: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Don Stewart
sven.panne: On Monday 10 September 2007 19:26, Don Stewart wrote: Yep, just send a patch. Or suggest what needs to happen. OK, I'll see what I can do next weekend, currently I'm busy with packaging/fixing GHC. I have similar code lying around in various places, and it would be nice if

Re: [Haskell-cafe] Re: Data.Binary Endianness

2007-09-11 Thread Lutz Donnerhacke
* apfelmus wrote: It's not that related, but I just got struck by an obvious idea, namely to put the endianness in an extra parameter data Endianness = Little | Big | Host putInt32 :: Endianness - Int - Put Please add the endianess to the state of the monad Put. setendianess ::

[Haskell-cafe] Can somebody give any advice for beginners?

2007-09-11 Thread clisper
haskell is greate but i don't know how to start. 2007-09-11 clisper ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Ketil Malde
On Tue, 2007-09-11 at 09:10 +0200, Sven Panne wrote: foo :: Binary a = ... - a - ...? This should probably mean foo is using some portable (de-)serialization, but doesn't care about the actual representation, I'm probably missing something, but: How can the format be portable if the

[Haskell-cafe] Building production stable software in Haskell

2007-09-11 Thread Peter Verswyvelen
The way I see it as a newcomer, Haskell shifts the typical imperical programming bugs like null pointers and buffer overruns towards space/time leaks, causing programs that either take exponentially long to complete, stack overflow, or fill up the swap file on disc because they consume

Re: [Haskell-cafe] Building production stable software in Haskell

2007-09-11 Thread Neil Mitchell
Hi Peter, The way I see it as a newcomer, Haskell shifts the typical imperical programming bugs like null pointers and buffer overruns towards space/time leaks, causing programs that either take exponentially long to complete, stack overflow, or fill up the swap file on disc because they

Re: [Haskell-cafe] Can somebody give any advice for beginners?

2007-09-11 Thread Peter Verswyvelen
Because I had a background in videogame development, I purchased The Haskell School of Expression. I found this a great book, but it has a fast pace, so be prepared. To me, Haskell was a bit like climbing a mountain which is largely covered by fog; you don't see anything until you've climbed high

[Haskell-cafe] Licenses and Libraries

2007-09-11 Thread H .
Hello, I have some questions connected more with the licenses and libraries as the language itself: Is it possible to: - publish Haskell source code under the BSD3 license - provide an executable binary together with the code including (compiled e.g. with 'ghc --make') standard (in the ghc

Re: [Haskell-cafe] Building production stable software in Haskell

2007-09-11 Thread Peter Verswyvelen
Well, I actually meant more something like the imperative equivalences of code coverage tools and unit testing tools, because I've read rumors that in Haskell, unit testing is more difficult because lazy evaluation will cause the units that got tested to be evaluated completely different

Re: [Haskell-cafe] Can somebody give any advice for beginners?

2007-09-11 Thread Dougal Stanton
On 11/09/2007, Peter Verswyvelen [EMAIL PROTECTED] wrote: To me, Haskell was a bit like climbing a mountain which is largely covered by fog; you don't see anything until you've climbed high enough, and then the view is really beautiful ;-) Either that or: the foothills are glorious, but as

Re: [Haskell-cafe] Building production stable software in Haskell

2007-09-11 Thread Neil Mitchell
Hi Well, I actually meant more something like the imperative equivalences of code coverage tools and unit testing tools, hpc and HUnit cover these two things pretty perfectly. hpc will be in GHC 6.8, and its really cool :-) because I've read rumors that in Haskell, unit testing is more

Re[2]: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Bulat Ziganshin
Hello Sven, Tuesday, September 11, 2007, 11:10:17 AM, you wrote: Haddock docs. The example above means something completely different, so I propose to add another class (e.g. ExternalBinary, better name needed) to this looks correct form theoretical POV but don't forget that then you will

Re: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Jules Bean
Ketil Malde wrote: On Tue, 2007-09-11 at 09:10 +0200, Sven Panne wrote: foo :: Binary a = ... - a - ...? This should probably mean foo is using some portable (de-)serialization, but doesn't care about the actual representation, I'm probably missing something, but: How can the format be

Re: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Ketil Malde
On Tue, 2007-09-11 at 12:01 +0100, Jules Bean wrote: How can the format be portable if the representation isn't unambigously defined? And if it is unabmigously defined, what's wrong with using it for externally defined data formats? It's portable because it works on other machines also

Re: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Jules Bean
Ketil Malde wrote: On Tue, 2007-09-11 at 12:01 +0100, Jules Bean wrote: How can the format be portable if the representation isn't unambigously defined? And if it is unabmigously defined, what's wrong with using it for externally defined data formats? It's portable because it works on other

RE: [Haskell-cafe] Building production stable software in Haskell

2007-09-11 Thread Peter Verswyvelen
That's a really weird statement, and one that goes completely opposite to my view of things. Do you have sources for these rumours? In a pure language, if you evaluate some code it will do exactly the same thing every time - there is no different behaviour. If you test the code, Sorry, I did

RE: [Haskell-cafe] Can somebody give any advice for beginners?

2007-09-11 Thread bf3
LOL! Another problem is that I always have to descend again for my main job which involves C#/C++, and all that climbing up and down is *very* tiersome. Peter -Original Message- From: Dougal Stanton [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 11, 2007 12:44 PM To: [EMAIL

Re: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Brandon S. Allbery KF8NH
On Sep 11, 2007, at 7:01 , Jules Bean wrote: The actual format used by Data.Binary is not explicitly described in any standard (although in most cases it's moderately obvious, and anyone can read the code), and it's not formally guaranteed that it will never change in a later version

[Haskell-cafe] Re: Tiny documentation request

2007-09-11 Thread Simon Marlow
Sven Panne wrote: 2. Could we make is so all items are collapsed initially? (Currently they're all expended initially - which makes it take rather a long time to find anything.) Again this depends on the use case: I'd vote strongly against collapsing the list initially, because that way the

Re: [Haskell-cafe] Can somebody give any advice for beginners?

2007-09-11 Thread Brent Yorgey
On 9/11/07, clisper [EMAIL PROTECTED] wrote: haskell is greate but i don't know how to start. A good place to start is the Haskell wiki: http://haskell.org/haskellwiki/Haskell On the left, look under Learning Haskell -- there's all kinds of great stuff linked from there. I would also

[Haskell-cafe] Re: Tiny documentation request

2007-09-11 Thread Simon Marlow
Thomas Schilling wrote: However, regarding the modules list. I think it should be easy to have optional javascript functionality to toggle the visibility of the module tree. The default visibility could be customized using a cookie. I don't know how to make cookies work purely in Javascript

Re: [Haskell-cafe] Tiny documentation request

2007-09-11 Thread Jules Bean
Andrew Coppin wrote: OTOH, I recently discovered that GHCi has the ability to show you what's defined in a given module without me having to wait 40 seconds for Firefox to start... Shame you can't scroll its output. (And still no help if you're not sure of the module name.) !!! Run ghci in

[Haskell-cafe] haskell and reflection

2007-09-11 Thread Greg Meredith
Haskellians, Am i wrong in my assessment that the vast majority of reflective machinery is missing from Haskell? Specifically, - there is no runtime representation of type available for programmatic representation - there is no runtime representation of the type-inferencing or

Re: [Haskell-cafe] Building production stable software in Haskell

2007-09-11 Thread David Roundy
On Tue, Sep 11, 2007 at 01:59:40PM +0200, Peter Verswyvelen wrote: That's a really weird statement, and one that goes completely opposite to my view of things. Do you have sources for these rumours? In a pure language, if you evaluate some code it will do exactly the same thing every time

Re: [Haskell-cafe] haskell and reflection

2007-09-11 Thread Neil Mitchell
Hi there is no runtime representation of type available for programmatic representation Data.Typeable.typeOf :: Typeable a = a - TypeRep there is no runtime representation of the type-inferencing or checking machinery Pretty much, no. The GHC API may provide some. there is no runtime

Re: [Haskell-cafe] haskell and reflection

2007-09-11 Thread Greg Meredith
Neil, Thanks very much for the detailed response. When we did Rosette, a reflective actor-based language, back in the late '80's and early '90's, we were very much influenced by Brian Cantwell Smith's account of reflection in 3-Lisp and similarly by Friedman and Wand's Mystery of the Tower

Re: [Haskell-cafe] haskell and reflection

2007-09-11 Thread Jules Bean
Greg Meredith wrote: Haskellians, Am i wrong in my assessment that the vast majority of reflective machinery is missing from Haskell? Specifically, * there is no runtime representation of type available for programmatic representation * there is no runtime representation of the

Re: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Neil Davies
So the answer for persistence is Data.Binary - ASN.1 converter that can be used in extrema? On 11/09/2007, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: On Sep 11, 2007, at 7:01 , Jules Bean wrote: The actual format used by Data.Binary is not explicitly described in any standard

Re: [Haskell-cafe] Building production stable software in Haskell

2007-09-11 Thread Justin Bailey
On 9/11/07, Peter Verswyvelen [EMAIL PROTECTED] wrote: How well and how can a Haskell program be tested to make sure it does not cause these space/time bugs? What tools are typically used? I've been fighting this myself. I had an especially nasty stack-overflow that took me weeks to track

[Haskell-cafe] Re: Tiny documentation request

2007-09-11 Thread manu
On Sep 11, 2007, Simon Marlow wrote: Please, please, someone do this for me. I tried, and failed, to get the layout right for the contents list in all browsers at the same time. The semantics of CSS is beyond my comprehension. Cheers, Simon Hi Simon, On the page

Re: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Bryan O'Sullivan
Jules Bean wrote: For these reasons, although it is very cool, I don't think it can be recommended as a basis for long-term file format definitions. Indeed, the authors have never claimed that this is what it's for. Unfortunately, because the authors haven't *disclaimed* this as a purpose,

Re: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Jules Bean
Bryan O'Sullivan wrote: (All of the above speaks of the 'high-level' Data.Binary not the 'low-level'.) Data.Binary *is* the low-level Data.Binary :-) I was distinguishing between these two levels: (1) High-level = Binary typeclass. Contains instances for many, many useful common types, the

Re: [Haskell-cafe] haskell and reflection

2007-09-11 Thread Greg Meredith
Jules, Thanks for these comments. i wouldn't judge Haskell solely on the basis of whether it embraced reflection as an organizing computational principle or as a toolbox for programmers. Clearly, you can get very far without it. And, it may be that higher-order functional gives you enough of the

[Haskell-cafe] Re: Can somebody give any advice for beginners?

2007-09-11 Thread Gracjan Polak
clisper clisper at 163.com writes: haskell is greate but i don't know how to start. Don't! Learning Haskell will change your world! For worse! Really! Don't do that, you still have time to go back! Or be damned like all of us here... Referential transparency will suck up your soul.

Re: [Haskell-cafe] Re: Can somebody give any advice for beginners?

2007-09-11 Thread Jonathan Cast
On Tue, 2007-09-11 at 16:55 +, Gracjan Polak wrote: clisper clisper at 163.com writes: haskell is greate but i don't know how to start. Don't! Learning Haskell will change your world! For worse! Really! Don't do that, you still have time to go back! Or be damned like

Re: [Haskell-cafe] haskell and reflection

2007-09-11 Thread Lauri Alanko
On Tue, Sep 11, 2007 at 07:33:54AM -0700, Greg Meredith wrote: Our analysis suggested the following breakdown - Structural reflection -- all data used in the evaluation of programs has a programmatic representation - Procedural reflection -- all execution machinery used in the

[Haskell-cafe] Basic FFI with GHC

2007-09-11 Thread Ronald Guida
How do I create C-libraries that I can load into GHCi? I am trying to do some basic FFI, and it's not working. Here's the background. I created three files, foo.h, foo.cpp, and test_foo.lhs. (source code below) Note: I am using MinGW/Msys under Windows XP. If I compile foo.cpp and then try

Re: [Haskell-cafe] Re: Tiny documentation request

2007-09-11 Thread Miguel Mitrofanov
When the index is generated with a more recent Haddock, you get a search field, which does an incremental search, so this might perhaps be more what you are looking for. A more aesthetical note: We should really get rid of the ugly table/CSS layout mixture, the lower part of the page renders

Re: [Haskell-cafe] haskell and reflection

2007-09-11 Thread Reinier Lamers
Op 11-sep-2007, om 18:43 heeft Greg Meredith het volgende geschreven: Thanks for these comments. i wouldn't judge Haskell solely on the basis of whether it embraced reflection as an organizing computational principle or as a toolbox for programmers. Clearly, you can get very far without

Re: [Haskell-cafe] Building production stable software in Haskell

2007-09-11 Thread Don Stewart
bf3: The way I see it as a newcomer, Haskell shifts the typical imperical programming bugs like null pointers and buffer overruns towards space/time leaks, causing programs that either take exponentially long to complete, stack overflow, or fill up the swap file on disc because they

Re: [Haskell-cafe] Building production stable software in Haskell

2007-09-11 Thread Don Stewart
bf3: Well, I actually meant more something like the imperative equivalences of code coverage tools and unit testing tools, because I've read rumors that in Haskell, unit testing is more difficult because lazy evaluation will cause the units that got tested to be evaluated We have full

Re: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Andrew Coppin
Don Stewart wrote: Just in case people didn't see, the `binary' package lives on http://darcs.haskell.org/binary/ However, Lennart Kolmodin, Duncan and I are actively maintaining and reviewing patches, so send them to one (or all) of us for review. Right. And this is the real

Re: [Haskell-cafe] Can somebody give any advice for beginners?

2007-09-11 Thread Andrew Coppin
Dougal Stanton wrote: On 11/09/2007, Peter Verswyvelen [EMAIL PROTECTED] wrote: To me, Haskell was a bit like climbing a mountain which is largely covered by fog; you don't see anything until you've climbed high enough, and then the view is really beautiful ;-) Either that or: the

Re: [Haskell-cafe] Can somebody give any advice for beginners?

2007-09-11 Thread Dan Piponi
On 9/11/07, Andrew Coppin [EMAIL PROTECTED] wrote: you can fall down a monad and not be able to escape... It's not so bad. It's in the nature of monads that after you've fallen in once, you can never get trapped any deeper. -- Dan ___ Haskell-Cafe

Re: [Haskell-cafe] Can somebody give any advice for beginners?

2007-09-11 Thread Ronald Guida
Dan Piponi wrote: On 9/11/07, Andrew Coppin [EMAIL PROTECTED] wrote: you can fall down a monad and not be able to escape... It's not so bad. It's in the nature of monads that after you've fallen in once, you can never get trapped any deeper. But you can climb higher... (Note: Best viewed in

Re: [Haskell-cafe] Can somebody give any advice for beginners?

2007-09-11 Thread David Menendez
On 9/11/07, Andrew Coppin [EMAIL PROTECTED] wrote: Dougal Stanton wrote: On 11/09/2007, Peter Verswyvelen [EMAIL PROTECTED] wrote: To me, Haskell was a bit like climbing a mountain which is largely covered by fog; you don't see anything until you've climbed high enough, and then the

Re: [Haskell-cafe] Tiny documentation request

2007-09-11 Thread Adrian Hey
Jules Bean wrote: Andrew Coppin wrote: OTOH, I recently discovered that GHCi has the ability to show you what's defined in a given module without me having to wait 40 seconds for Firefox to start... Shame you can't scroll its output. (And still no help if you're not sure of the module name.)

Re: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Don Stewart
andrewcoppin: Don Stewart wrote: Just in case people didn't see, the `binary' package lives on http://darcs.haskell.org/binary/ However, Lennart Kolmodin, Duncan and I are actively maintaining and reviewing patches, so send them to one (or all) of us for review. Right. And

Re: [Haskell-cafe] Licenses and Libraries

2007-09-11 Thread Don Stewart
h._h._h._: Hello, I have some questions connected more with the licenses and libraries as the language itself: Is it possible to: - publish Haskell source code under the BSD3 license - provide an executable binary together with the code including (compiled e.g. with 'ghc --make')

[Haskell-cafe] GraphicsMagick binding for Haskell

2007-09-11 Thread Tim Chevalier
As a Hackathon project, I'm thinking of trying to write a Haskell binding for the GraphicsMagick image manipulation library (http://www.graphicsmagick.org/). Has anyone done this already? If not, would anyone else besides me use it? If you think there's a better library out there that serves a

[Haskell-cafe] Is take behaving correctly?

2007-09-11 Thread PR Stanley
Hi take 1000 [1..3] still yields [1,2,3] I thought it was supposed to return an error. Any ideas? Thanks, Paul ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Is take behaving correctly?

2007-09-11 Thread Tim Chevalier
On 9/11/07, PR Stanley [EMAIL PROTECTED] wrote: Hi take 1000 [1..3] still yields [1,2,3] I thought it was supposed to return an error. Any ideas? No, that's the behavior for take specified in the Haskell 98 report: http://haskell.org/onlinereport/standard-prelude.html -- take n, applied to a

Re: [Haskell-cafe] Is take behaving correctly?

2007-09-11 Thread Brent Yorgey
On 9/11/07, PR Stanley [EMAIL PROTECTED] wrote: Hi take 1000 [1..3] still yields [1,2,3] I thought it was supposed to return an error. Any ideas? Thanks, Paul If for some reason you want a version that does return an error in that situation, you could do something like the following:

Re: [Haskell-cafe] Is take behaving correctly?

2007-09-11 Thread PR Stanley
I suppose I'm thinking of head or tail - e.g. head [] or tail []. I'm trying to write my own version of the find function. I have a few ideas but not quite sure which would be more suitable in the context of FP. Any advice would be gratefully received - e.g. do I use recursion, list

Re: [Haskell-cafe] Is take behaving correctly?

2007-09-11 Thread Don Stewart
byorgey: On 9/11/07, PR Stanley [EMAIL PROTECTED] wrote: Hi take 1000 [1..3] still yields [1,2,3] I thought it was supposed to return an error. Any ideas? Thanks, Paul If for some reason you want a version that does return an error in that situation,

Re: [Haskell-cafe] Is take behaving correctly?

2007-09-11 Thread Brent Yorgey
On 9/11/07, Don Stewart [EMAIL PROTECTED] wrote: byorgey: On 9/11/07, PR Stanley [EMAIL PROTECTED] wrote: Hi take 1000 [1..3] still yields [1,2,3] I thought it was supposed to return an error. Any ideas? Thanks, Paul If for some reason you want a

Re: [Haskell-cafe] Is take behaving correctly?

2007-09-11 Thread John Meacham
On Tue, Sep 11, 2007 at 07:38:18PM -0400, Brent Yorgey wrote: On 9/11/07, PR Stanley [EMAIL PROTECTED] wrote: Hi take 1000 [1..3] still yields [1,2,3] I thought it was supposed to return an error. Any ideas? Thanks, Paul If for some reason you want a version that does return an

Re: [Haskell-cafe] Is take behaving correctly?

2007-09-11 Thread PR Stanley
Let me get this right, are you saying it's unsafe when it returns an error? Paul At 00:40 12/09/2007, you wrote: byorgey: On 9/11/07, PR Stanley [EMAIL PROTECTED] wrote: Hi take 1000 [1..3] still yields [1,2,3] I thought it was supposed to return an error. Any

Re: [Haskell-cafe] Is take behaving correctly?

2007-09-11 Thread Don Stewart
prstanley: I suppose I'm thinking of head or tail - e.g. head [] or tail []. I'm trying to write my own version of the find function. I have a few ideas but not quite sure which would be more suitable in the context of FP. Any advice would be gratefully received - e.g. do I use

Re: [Haskell-cafe] Is take behaving correctly?

2007-09-11 Thread Don Stewart
byorgey: On 9/11/07, Don Stewart [EMAIL PROTECTED] wrote: byorgey: On 9/11/07, PR Stanley [EMAIL PROTECTED] wrote: Hi take 1000 [1..3] still yields [1,2,3] I thought it was supposed to return an error. Any ideas?

Re: [Haskell-cafe] Is take behaving correctly?

2007-09-11 Thread Don Stewart
prstanley: Let me get this right, are you saying it's unsafe when it returns an error? Partial functions may crash your program, so that's unsafe by some definitions, yep. We have tools that analyse programs for such bugs, in fact (Neil's `catch' program). -- Don

[Haskell-cafe] Prime monads?

2007-09-11 Thread Greg Meredith
Haskellians, Is there a characterization of prime monads? Here the notion of factorization i'm thinking about is decomposition into adjoint situations. For example, are there monads for which there are only the Kleisli and Eilenberg-Moore decompositions into adjoint situations? Would this be a

Re: [Haskell-cafe] Is take behaving correctly?

2007-09-11 Thread Derek Elkins
On Tue, 2007-09-11 at 16:48 -0700, Don Stewart wrote: byorgey: On 9/11/07, Don Stewart [EMAIL PROTECTED] wrote: byorgey: On 9/11/07, PR Stanley [EMAIL PROTECTED] wrote: Hi take 1000 [1..3] still yields [1,2,3] I thought it

Re: [Haskell-cafe] GraphicsMagick binding for Haskell

2007-09-11 Thread brad clawsie
On Tue, Sep 11, 2007 at 03:41:59PM -0700, Tim Chevalier wrote: As a Hackathon project, I'm thinking of trying to write a Haskell binding for the GraphicsMagick image manipulation library (http://www.graphicsmagick.org/). please do! this would be a huge asset for us. image/graphicsmagick and