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 rep

Re: binary files in haskell

2001-02-08 Thread John Meacham
Since there seems to be general support for the idea of some sort of Portable Byte IO package, I will work on am implementation of my proposal for ghc being the platform I am most familiar with. I really like the simplicity of the hPut and hGet idea and will probably use it as my mechanism for imp

Re: binary files in haskell

2001-02-06 Thread Erik Meijer
esday, February 06, 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? > &g

Re: binary files in haskell

2001-02-06 Thread Koen Claessen
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 called: Monad.filter, Monad.zipWith The lazy programmer can t

Re: binary files in haskell

2001-02-06 Thread Marcin 'Qrczak' Kowalczyk
On Tue, 6 Feb 2001, Stefan Karrmann wrote: > > type Byte = Word8 > > I would prefer > > type Octet = Word8 > > to emphasise that the functions really uses 8 bits. I would define Byte as something different on an architecture where the basic file unit is not 8 bits. It's like char in C. -- M

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

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 a

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 als

Re: binary files in haskell

2001-02-06 Thread Olaf Chitil
Marcin 'Qrczak' Kowalczyk wrote: > type Byte = Word8 > > IMHO it looks nicer to have Byte in function names, so there can be such > type synonym too. I agree that Byte is nicer than Word8. So why is this type synonym not in the library Word of the FFI? I think that is the right place for it. -

Re: binary files in haskell

2001-02-06 Thread Marcin 'Qrczak' Kowalczyk
On Tue, 6 Feb 2001, Olaf Chitil wrote: > I just see one problem with John's proposal: the type Byte. type Byte = Word8 IMHO it looks nicer to have Byte in function names, so there can be such type synonym too. I would call the module ByteIO or BinaryIO instead of cryptic BIO. -- Marcin 'Qrcz

Re: binary files in haskell

2001-02-06 Thread Olaf Chitil
Simon Marlow wrote: > > http://www.ugcs.caltech.edu/~john/computer/haskell/ > > 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 (

RE: binary files in haskell

2001-02-06 Thread Simon Marlow
> 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

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 add

Re: binary files in haskell

2001-01-27 Thread Timmy Douglas
Sven Panne <[EMAIL PROTECTED]> said: >[ Seems I *can't* mail in a sane way anymore, so please excuse my last > half-baked one. But at least I've learned now that Ctrl-RET means > "send immediately" in Netscape. Great idea! Here my next try... ] > >Timmy Douglas wrote: >> I was wondering if anyon

Re: binary files in haskell

2001-01-27 Thread Sven Panne
[ Seems I *can't* mail in a sane way anymore, so please excuse my last half-baked one. But at least I've learned now that Ctrl-RET means "send immediately" in Netscape. Great idea! Here my next try... ] Timmy Douglas wrote: > I was wondering if anyone here has a solution for writing binary fi

Re: binary files in haskell

2001-01-27 Thread Sven Panne
[ OK, let's see if I get a typo-free mail out of the door *this* time... :-] Timmy Douglas wrote: > I was wondering if anyone here has a solution for writing binary files > that works in hugs and ghc that doesn't require getting libs. I dont' know exactly about the current status of Hugs' libs,

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> laz

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 fil

Re: Binary files in Haskell

1998-03-12 Thread Timothy Robin BARBOUR
> "Steve" == Steve Roggenkamp <[EMAIL PROTECTED]> writes: Steve> I currently working on a database which consists mainly of Steve> integers. I have to search large arrays of these integers Steve> which may contain over a hundred million entries. With Steve> this amount of da

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 haul

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, bu

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 a

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 > gra

Re: Binary files in Haskell

1998-03-10 Thread Charles Martin
At 07:52 PM 3/10/98 GMT, Alex Ferguson wrote: >Steve Roggenkamp: >> I would like to use Haskell for several larger scale projects, but I >> can't figure out how to read and write binary data. > >Steve, can you clarify what sort of binary file manipulation it is you >are actually looking for,... 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 prod

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 t

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 da

Re: Binary files in Haskell

1998-02-25 Thread Timothy Robin BARBOUR
> "Malcolm" == Malcolm Wallace <[EMAIL PROTECTED]> writes: Malcolm> space-efficiency, portability, and good monitoring tools Malcolm> (profiler/tracer). I noticed the tracer stuff on the nhc web-site. It looks very much like a declarative-debugger, although that term never appeared i

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

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-24 Thread Simon Marlow
Timothy Robin BARBOUR <[EMAIL PROTECTED]> writes: > No need to relocate on an Alpha - just use a different high 32-bits > for each persistent store. Not that I've got an Alpha yet... Sure - not a portable solution, though. > BTW I will probably get an Alpha sometime for running ghc, but it > wi

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 no

Re: Binary files in Haskell

1998-02-24 Thread Timothy Robin BARBOUR
> "Malcolm" == Malcolm Wallace <[EMAIL PROTECTED]> writes: Malcolm> With our current design, it is possible to map binary Malcolm> files into memory and vice versa, in a completely Malcolm> orthogonal fashion. Do you mean "map" as in mmap or just flattening into and out of binary

Re: Binary files in Haskell

1998-02-24 Thread Timothy Robin BARBOUR
> "Simon" == Simon Marlow <[EMAIL PROTECTED]> writes: Simon> If I understand this right, you're suggesting essentially Simon> dumping out part of the Haskell heap to a file. Assuming Simon> the data you want to dump out is closed (i.e. has no Simon> external references) and i

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 reloa

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 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 p

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 current

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-writin

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 mis

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 t