Re: How to best add logging/debugging code?

2003-11-17 Thread Johannes Waldmann
Ben Escoto wrote: Hi all, does anyone have any tips on how to insert debugging or logging statements through a program? Here are two possibilities: another thing I found quite useful is to add a component { .. , info :: Doc } to my data types, and then set its value at each function call: f x y

Re: How to best add logging/debugging code?

2003-11-17 Thread ketil+haskell
Johannes Waldmann [EMAIL PROTECTED] writes: f x y = ( ... ) { info = parens $ fsep [ text f, info x, info y ] } Cool! that way you always know who built what. and it's cheap - if you don't use this information, then it's never created (due to laziness). Uh..is that really true? I would

Re: Implementation of while loop

2003-11-17 Thread Abraham Egnor
While while can be implemented in haskell, I would strongly suggest you look at using the many higher-order functions available (foldl/foldr, map, filter, etc.) - they're much more in line with the spirit of the language, and will lend themselves to much clearer expressions once you get the hang

ANN: H98 FFI Addendum 1.0, Release Candidate 16

2003-11-17 Thread Manuel M T Chakravarty
Dear Haskell Folks, Release Candidate 16 of the H98 FFI Addendum 1.0 is now available from http://www.cse.unsw.edu.au/~chak/haskell/ffi/ Since the last version of the Addendum announced on [EMAIL PROTECTED], namely RC12, the FFI Task Force decided on a slight generalisation of the interface

Subsumption in partially ordered sets

2003-11-17 Thread Graham Klyne
I have a need for an algorithm to perform subsumption on partially ordered sets of values. That is, given a selection of values from a partially ordered set, remove all values from the collection that are less than some other member of the collection. Below is some code I have written, which

Subsumption in partially ordered sets

2003-11-17 Thread Tom Pledger
Graham Klyne writes: : | Below is some code I have written, which works, but I'm not sure | that it's especially efficient or elegant. Are there any published | Haskell libraries that contain something like this? Hi. Partially ordered sets are in cahoots with lattices, so you may be

Re: Subsumption in partially ordered sets

2003-11-17 Thread rvollmert-lists
I have a need for an algorithm to perform subsumption on partially ordered sets of values. That is, given a selection of values from a partially ordered set, remove all values from the collection that are less than some other member of the collection. That is, you want the maxima, right? The

There is flexible exception handling in Haskell?

2003-11-17 Thread 7253146
Hi all. I am porting to Haskell a small zlib-based library for .zip files (I have not seen any released package for it, although it should very useful). The matters come when I try to address exceptional conditions: all the library functions return a integer code with OK/SOMEERROR meaning. The

There is flexible exception handling in Haskell?

2003-11-17 Thread 7253146
Hi all. I am porting to Haskell a small zlib-based library for .zip files (I have not seen any released package for it, although it should very useful). The matters come when I try to address exceptional conditions: all the library functions return a integer code with OK/SOMEERROR meaning. The

Re: There is flexible exception handling in Haskell?

2003-11-17 Thread Bernard James POPE
Hi all. I am porting to Haskell a small zlib-based library for .zip files (I have not seen any released package for it, although it should very useful). The matters come when I try to address exceptional conditions: all the library functions return a integer code with OK/SOMEERROR meaning.