Re: [Haskell-cafe] binary serialization

2009-03-04 Thread Tim Newsham
fft1976: Is there a way to do binary serialization of Haskell values (in GHC, at least)? If you propose a method, what are its type safety and portability properties? There are many ways. See Data.Binary (fast, portable). Most are type safe, or additional safety can be added. I would add to t

Re: [Haskell-cafe] binary serialization

2009-03-04 Thread Don Stewart
fft1976: > Is there a way to do binary serialization of Haskell values (in GHC, > at least)? If you propose a method, what are its type safety and > portability properties? There are many ways. See Data.Binary (fast, portable). Most are type safe, or additional safety can be added. ___

[Haskell-cafe] binary serialization

2009-03-04 Thread FFT
Is there a way to do binary serialization of Haskell values (in GHC, at least)? If you propose a method, what are its type safety and portability properties? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/ha

Re: Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-06 Thread Duncan Coutts
On Fri, 2007-07-06 at 08:26 +0200, Ketil Malde wrote: > On Thu, 2007-07-05 at 18:08 +0100, Duncan Coutts wrote: > > > > > - Found that on hackage, downloaded and built OK. Lots of scary > > > > warnings about happy, greencard etc, not being found during configure, > > > > but let's go on. > > > >

Re: Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-06 Thread Ketil Malde
On Thu, 2007-07-05 at 18:08 +0100, Duncan Coutts wrote: > > > - Found that on hackage, downloaded and built OK. Lots of scary > > > warnings about happy, greencard etc, not being found during configure, > > > but let's go on. > > I've complained about these before, although I don't think anyone >

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Donald Bruce Stewart
p.f.moore: > On 05/07/07, Jonathan Cast <[EMAIL PROTECTED]> wrote: > >Can't say I agree. I've been learning Python, and have been very > >un-impressed > >so far with its library coverage, which I would rate no better than (in > >terms > >of the POSIX bindings, worse than) Haskell. > > It probab

[Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Dominic Steinitz
> >> (Bonus points for being able to parse ASN.1 and generate appropriate >> Haskell datatypes & serialization primitives automatically :-) ) > > I think there's at least an ASN.1 definition in the crypto library. > Dominic might be able to enlighten us on that. > No bonus points I'm afraid. Th

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Dave Bayer
On Jul 5, 2007, at 9:52 AM, Paul Moore wrote: You're changing the problem from finding a Haskell library (which only needs to be installed on the development machine at compile time) to finding a 3rd party utility, which has to be installed at runtime ... Not a good trade-off. The intersecti

Re: Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Ian Lynagh
On Thu, Jul 05, 2007 at 06:08:45PM +0100, Duncan Coutts wrote: > On Thu, 2007-07-05 at 17:51 +0100, Neil Mitchell wrote: > > > > > - Found that on hackage, downloaded and built OK. Lots of scary > > > warnings about happy, greencard etc, not being found during configure, > > > but let's go on. > >

Re: Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Duncan Coutts
On Thu, 2007-07-05 at 17:51 +0100, Neil Mitchell wrote: > Hi > > It's not a great experience now, but hopefully things are moving in > the right direction. > > > - Found crypto 3.0.3 on hackage. > > - Tried to build, it depends on NewBinary > > Cabal-install is intended to remove this problem, s

Re: Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Duncan Coutts
On Thu, 2007-07-05 at 17:39 +0100, Paul Moore wrote: > I see you've already responded, and we're in broad agreement. So I > won't labour the point. It's an infrastructure issue rather than a > technical one, and it *will* improve. What will be interesting is how > much the generally lousy Windows e

Re: Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Paul Moore
On 05/07/07, Neil Mitchell <[EMAIL PROTECTED]> wrote: > - But no simple examples, and the haddoc docs show APIs, but not usage examples! Complain to the author. Yes, that's completely unrelated to library availability issues. I got off the topic, in all my ranting. Sorry. Part of the proble

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Philip Armstrong
On Thu, Jul 05, 2007 at 09:41:23AM -0700, Dave Bayer wrote: There are people who claim with a straight face that they migrated to OS X primarily to use TextMate http://www.textmate.com Presumably you mean http://macromates.com/ ? Phil -- http://www.kantaka.co.uk/ .oOo. public key: h

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Paul Moore
On 05/07/07, Dave Bayer <[EMAIL PROTECTED]> wrote: How's this, only one line is specific to your problem: [...] > md5 <- doShell "md5 -q md5.hs" Doesn't work on my (Windows) PC, where I have no md5 command available. While I agree in theory with the idea of combining focused tools, it's a

Re: Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Neil Mitchell
Hi It's not a great experience now, but hopefully things are moving in the right direction. - Found crypto 3.0.3 on hackage. - Tried to build, it depends on NewBinary Cabal-install is intended to remove this problem, so that you can say "i want crypto" and it gets everything that requires.

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Dave Bayer
On Jul 5, 2007, at 8:00 AM, Paul Moore wrote: It probably depends on your perspective. I've found lots of tasks that would be a simple library call in Python, but which require me to write the code myself in Haskell. Examples: * Calculate the MD5 checksum of a file How's this, only one line

Re: Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Paul Moore
On 05/07/07, Paul Moore <[EMAIL PROTECTED]> wrote: The need I had for these is no longer current, but sometime I'll try an experiment and see how easy it is, on a relatively clean Windows box with just GHC installed, to grab and use these libraries. Just for fun I had a go with crypto: - Found

Re[4]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Bulat Ziganshin
Hello Paul, Thursday, July 5, 2007, 8:07:34 PM, you wrote: > note: with Python, I'm used to 3rd party modules being available as > Windows installer packages - does the concept of an installable binary > for something like MissingH, which I can just install and use, make > sense for a compiled la

Re: Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Duncan Coutts
On Thu, 2007-07-05 at 17:07 +0100, Paul Moore wrote: > On 05/07/07, Bulat Ziganshin <[EMAIL PROTECTED]> wrote: > > > * Gzip compress a data stream > > zlib > > > > > * Send an email > > > * Parse an ini file > > >> The one thing off the top of my head that Python had was Base64, but > > >> that's

Re: Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Paul Moore
On 05/07/07, Bulat Ziganshin <[EMAIL PROTECTED]> wrote: > * Gzip compress a data stream zlib > * Send an email > * Parse an ini file >> The one thing off the top of my head that Python had was Base64, but that's MissingH > * Calculate the MD5 checksum of a file crypto Thanks. The need I had

Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Bulat Ziganshin
Hello Paul, Thursday, July 5, 2007, 7:00:46 PM, you wrote: > * Gzip compress a data stream zlib > * Send an email > * Parse an ini file >> The one thing off the top of my head that Python had was Base64, but that's >> 20 MissingH > * Calculate the MD5 checksum of a file crypto -- Best reg

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Paul Moore
On 05/07/07, Jonathan Cast <[EMAIL PROTECTED]> wrote: Can't say I agree. I've been learning Python, and have been very un-impressed so far with its library coverage, which I would rate no better than (in terms of the POSIX bindings, worse than) Haskell. It probably depends on your perspective.

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Jonathan Cast
On Thursday 05 July 2007, Thomas Conway wrote: > I was explaining Haskell to a perl/python hacking friend recently and > characterized things thus: > > Perl is a horrible language with fantastic libraries. > Haskell is a fantastic language with horrible libraries. > > Actually, many of the librarie

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Thomas Conway
I was explaining Haskell to a perl/python hacking friend recently and characterized things thus: Perl is a horrible language with fantastic libraries. Haskell is a fantastic language with horrible libraries. Actually, many of the libraries that exist for Haskell *are* fantastic, it's just that H

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Philip Armstrong
On Thu, Jul 05, 2007 at 08:50:42AM +1000, Donald Bruce Stewart wrote: [useful stuff] So, in fact pretty much everything I was looking for exists, in some form or other! It's just a bit hard to find at the moment, perhaps because none of this stuff is regarded as 'core Haskell' by any of the tuto

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Donald Bruce Stewart
phil: > On Wed, Jul 04, 2007 at 09:44:13PM +1000, Donald Bruce Stewart wrote: > >Binary instances are pretty easy to write. For a simple data type: > > > > > instance Binary Exp where > > > put (IntE i) = do put (0 :: Word8) > > > put i

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Philip Armstrong
On Wed, Jul 04, 2007 at 07:36:11PM +0100, Andrew Coppin wrote: Philip Armstrong wrote: [1] Which sick application *needs* intermixed endianness? *Clearly* you've never been to Singapore... ...er, I mean, "Ever tried playing with networking protocol stacks?" No (thankfully?). Phil -- http:

Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Bulat Ziganshin
Hello Philip, Wednesday, July 4, 2007, 9:41:27 PM, you wrote: > I'm thinking of the elimination of the boxing of values drawn out of > the input stream where possible, eg if I was writing a stream > processor that folded across the values in the input stream, it would > (presumably) be more effic

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Andrew Coppin
Philip Armstrong wrote: [1] Which sick application *needs* intermixed endianness? *Clearly* you've never been to Singapore... ...er, I mean, "Ever tried playing with networking protocol stacks?" ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.o

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Philip Armstrong
On Wed, Jul 04, 2007 at 09:15:59PM +0400, Bulat Ziganshin wrote: Does that mean that the code is unwritten or that the documentation is unwritten. IAMFI :) of course all "unwritten" notes means unfinished docs. library contains more than 100 functions so it was not easy to document them all. yo

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Stefan O'Rear
On Wed, Jul 04, 2007 at 02:50:42PM +0100, Philip Armstrong wrote: >> The Data.Binary comes with one tool to derive these. The DrIFT >> preprocessor >> also can, as can Stefan O'Rear's SYB deriver. >> >> I just write them by hand, or use the tool that comes with the lib. >> >> More docs here, >>

Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Bulat Ziganshin
Hello Philip, Wednesday, July 4, 2007, 7:31:56 PM, you wrote: > On Wed, Jul 04, 2007 at 06:52:08PM +0400, Bulat Ziganshin wrote: >>Hello Philip, >> >>Wednesday, July 4, 2007, 5:50:42 PM, you wrote: >>> This doesn't seem to deal with endianness. Am I missing something? >> >>alternative: >>http://h

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Philip Armstrong
On Wed, Jul 04, 2007 at 06:52:08PM +0400, Bulat Ziganshin wrote: Hello Philip, Wednesday, July 4, 2007, 5:50:42 PM, you wrote: This doesn't seem to deal with endianness. Am I missing something? alternative: http://haskell.org/haskellwiki/Library/AltBinary http://haskell.org/haskellwiki/Librar

Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Bulat Ziganshin
Hello Philip, Wednesday, July 4, 2007, 5:50:42 PM, you wrote: > This doesn't seem to deal with endianness. Am I missing something? alternative: http://haskell.org/haskellwiki/Library/AltBinary http://haskell.org/haskellwiki/Library/Streams -- Best regards, Bulatmail

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Philip Armstrong
On Wed, Jul 04, 2007 at 09:44:13PM +1000, Donald Bruce Stewart wrote: Binary instances are pretty easy to write. For a simple data type: > instance Binary Exp where > put (IntE i) = do put (0 :: Word8) > put i > put (O