Re: binary files in haskell

2001-02-08 Thread Fergus Henderson
On 08-Feb-2001, John Meacham [EMAIL PROTECTED] wrote: A nice advantage of using my mid-level routines is that there are very little requirements placed on 'Byte' as a type, this means that as long as to the outside world you only read in 8 bit values and spit 8 bit values out you can

Re: binary files in haskell

2001-02-06 Thread Koen Claessen
Marcin 'Qrczak' Kowalczyk wrote: | IMHO it looks nicer to have Byte in function names, so | there can be such type synonym too. Style Warning! Why do many people when designing libraries not make full use of the Haskell module system? Instead of writeByte readByte (or so), one could

Re: binary files in haskell

2001-02-06 Thread Johannes Waldmann
Style Warning! ... writeByte - Byte.write Yes yes yes please! Often, if someone writes identifiersWithSuffix, the suffix actually carries a type information or a module information, and the programmer should use the type resp. module system of the language to express that. Should this also

Re: binary files in haskell

2001-02-06 Thread Stefan Karrmann
Marcin 'Qrczak' Kowalczyk schrieb folgendes am Tue, Feb 06, 2001 at 12:54:29PM +0100: On Tue, 6 Feb 2001, Olaf Chitil wrote: I just see one problem with John's proposal: the type Byte. type Byte = Word8 I would prefer type Octet = Word8 to emphasise that the functions really uses 8

Re: binary files in haskell

2001-02-06 Thread Erik Meijer
2001 6:25 AM Subject: Re: binary files in haskell Johannes Waldmann wrote: | Should this also apply to names in the standard | library? like Monad (filterM, zipWithM ,..) I mean, | theoretically yes, but is it feasible to change it? Obviously, these functions should have been call

RE: binary files in haskell

2001-02-06 Thread Simon Marlow
How about this slightly more general interface, which works with the new FFI libraries, and is trivial to implement on top of the primitives in GHC's IOExts: hPut :: Storable a = Handle - a - IO () hGet :: Storable a = Handle - IO a What about endianess? In

Re: binary files in haskell

2001-02-05 Thread John Meacham
There is actually NO way with haskell 98 to portably read and write binary files. and many libraries which provide this feature are inherently non portable, (they assume a Haskell Char = C char = byte) which is not necisarily the case. I wrote up a proposal for a binary file IO mechanism to be

Re: Binary files in Haskell

1998-03-16 Thread Malcolm Wallace
Malcolm In fact, Binary allows you to process the data directly Malcolm from the disk rather than hauling it all into memory. Malcolm This eliminates start-up time altogether. What's more, Malcolm provided the file is used read-only, you can use pure Malcolm lazy

Re: Binary files in Haskell

1998-03-14 Thread Timothy Robin BARBOUR
"Malcolm" == Malcolm Wallace [EMAIL PROTECTED] writes: Malcolm In fact, Binary allows you to process the data directly Malcolm from the disk rather than hauling it all into memory. Malcolm This eliminates start-up time altogether. What's more, Malcolm provided the file is used

Re: Binary files in Haskell

1998-03-12 Thread Malcolm Wallace
If the representation is simple enough, you might consider accessing the database via C ... Of course, Binary or Native would be easier, but the start-up time for a large database might be a problem. In fact, Binary allows you to process the data directly from the disk rather than hauling

Re: Binary files in Haskell

1998-03-11 Thread Malcolm Wallace
Alex Ferguson and (earlier) Yoshihiko Ichikawa ask for clarification of the intent of the discussion on binary I/O. It might help if I outline the capabilities of the Binary library (currently available only for nhc13, but as Simon PJ notes, if you want it in ghc/hugs, ask him). 1. Reading

Re: Binary files in Haskell

1998-03-11 Thread Simon L Peyton Jones
Real world example: development tools process a large geometric data set to build a run-time optimized BSP tree with precalculated lighting and collision information. The user application will not modify this data, but it will have to load it dynamically without slowing down a 30Hz

Re: Binary files in Haskell

1998-03-11 Thread Steve Roggenkamp
Alex Ferguson wrote: Tony Davie: And anyway didn't this start out about how to do I/O on binary data. To be honest, I'm not sure this discussion does necessarily address the original query: Steve Roggenkamp: I would like to use Haskell for several larger scale projects, but I

Re: Binary files in Haskell

1998-02-26 Thread Martin Norbäck
On Wed, 25 Feb 1998, Jerzy Karczmarczuk wrote: : PS. Could somebody inform me what is the current status of : multi-parametric classes? Concretely (for example) I would : like to construct a generic Universal Parser : : type Uparser a c = [c] - [(a,[c])] : : which consumes any stream and

Re: Binary files in Haskell

1998-02-25 Thread Malcolm Wallace
Tim writes: I noticed the tracer stuff on the nhc web-site. It looks very much like a declarative-debugger, although that term never appeared in the documentation I read. Will it in fact be a declarative-debugger ? Debugging is certainly one of the applications of a tracer. I'm not sure

Re: Binary files in Haskell

1998-02-25 Thread S. Alexander Jacobson
On Wed, 25 Feb 1998, Jerzy Karczmarczuk wrote: Compete in the space of professional production quality languages? I am sorry, but if one day the Haskell, or any other language creators decide to include *everything* into their language, it will be The End of it. Yes that comment went too

Re: Binary files in Haskell

1998-02-25 Thread Jerzy Karczmarczuk
The discussion about heap dumps, binary persistent objects, etc. continues. S. Alexander Jacobson: Java comes with a serialization mechanism that allows the user to save and load all objects ... Object databases, like PSE, provide caching and indirection facilities ... Relational

Re: Binary files in Haskell

1998-02-24 Thread Tony Davie
Tim Barbour writes "Tony" == Tony Davie [EMAIL PROTECTED] writes: Tony This has well know disadvantages. Simon has already pointed Tony out that it's not relocatable. It's also limited to the size Tony of virtual memory and takes up that amount of space even Tony though most of

Re: Binary files in Haskell

1998-02-24 Thread Timothy Robin BARBOUR
"Tony" == Tony Davie [EMAIL PROTECTED] writes: Tony This has well know disadvantages. Simon has already pointed Tony out that it's not relocatable. It's also limited to the size Tony of virtual memory and takes up that amount of space even Tony though most of it may not be used.

Re: Binary files in Haskell

1998-02-24 Thread S. Alexander Jacobson
The debate about heavy or light-weight saving sounds a lot like the debate in traditional programming languages of how users should implement persistent state. Java comes with a serialization mechanism that allows the user to save and load all objects reachable from a particular object root. It

Re: Binary files in Haskell

1998-02-23 Thread Simon L Peyton Jones
I would like to use Haskell for several larger scale projects, but I can't figure out how to read and write binary data. It does not appear that the language supports binary files. Am I missing something? Colin Runciman and his Merrie Men are working on writing Haskell values into binary

Re: Binary files in Haskell

1998-02-23 Thread Olivier Lefevre
--MimeMultipartBoundary Content-Type: text/plain; charset="us-ascii" This thread and particularly the following passage: "If I understand this right, you're suggesting essentially dumping out part of the Haskell heap to a file." reminds me very strongly of APL, where dumping the

Re: Binary files in Haskell

1998-02-23 Thread Malcolm Wallace
"Steve" == Steve Roggenkamp [EMAIL PROTECTED] writes: Steve I would like to use Haskell for several larger scale Steve projects, but I can't figure out how to read and write Steve binary data. It does not appear that the language supports Steve binary files. Am I missing something?

Re: Binary files in Haskell

1998-02-23 Thread Yoshihiko ICHIKAWA
Sorry for interruption, but I feel this thread of discussion includes four different aspects of `binary' data: 1. Reading and writing binary data in a prescribed format. Typical examples are image data in GIF, TIFF, Sun Raster etc, and user-account statistics files used in Unix.

Re: Binary files in Haskell

1998-02-23 Thread Tony Davie
This thread and particularly the following passage: "If I understand this right, you're suggesting essentially dumping out part of the Haskell heap to a file." reminds me very strongly of APL, where dumping the current state of the system into a binary file that you can later reload (and

Re: Binary files in Haskell

1998-02-23 Thread Olivier Lefevre
--MimeMultipartBoundary Content-Type: text/plain; charset="us-ascii" Tony Davie wrote: This has well know disadvantages. Simon has already pointed out that it's not relocatable. How is it done in APL and in other systems that do it (SmallTalk and some LISP systems, according to another

Re: Binary files in Haskell

1998-02-22 Thread Timothy Robin BARBOUR
"Steve" == Steve Roggenkamp [EMAIL PROTECTED] writes: Steve I would like to use Haskell for several larger scale Steve projects, but I can't figure out how to read and write Steve binary data. It does not appear that the language supports Steve binary files. Am I missing

Re: Binary files in Haskell

1998-02-22 Thread Simon Marlow
Timothy Robin BARBOUR [EMAIL PROTECTED] writes: There is another way one might proceed. Why not just use a memory-mapped file (mmap) to make the data persistent in-place ? This would be a way of getting efficient persistence of (almost) any Haskell data structure without any code-writing and

Re: Binary files in Haskell

1997-03-21 Thread malcolm
Phil Trinder asked: Do any Haskell implementations support Binary files? At York we have a version of nhc13 which supports, amongst other things, binary file I/O. We hope to release it to the world fairly soon. We have confirmed that binary files enable a faster data transfer rate than the