Re: Representing cyclic data structures efficiently in Haskell

2003-07-07 Thread Sarah Thompson
;t need to grow the array). But it works. The finite map from n to Node seems like a good idea. Does representing the adjacency list as a flat array cause any problems? Sarah -- -- / __+ / Sarah Thompson

Representing cyclic data structures efficiently in Haskell

2003-07-07 Thread Sarah Thompson
ever a great idea. Thank you in advance, -- ------ / __+ / Sarah Thompson / / (_ _ _ _ |_ /* / / __)(_|| (_|| ) / [EMAIL PROTECTED] * / / + / http://findatlantis.com/ / -- _

Re: Naive question on lists of duplicates

2003-06-05 Thread Sarah Thompson
overlapping promotions. Total complexity should effectively be O(N + N log N + N + N log N + N) which of course just collapses to O(N log N). -- -- / __+ / Sarah Thompson / / (_ _ _ _ |_ /* / / __)

Re: Graphics output from Haskell as eps

2003-02-17 Thread Sarah Thompson
> Has anyone done much work on outputting graphics in eps format > directly from > Haskell? Hmm... Actually it turns out to be really easy to generate EPS directly, so long as you're mostly just interested in drawing lines, which I am. I've already got something working which will probably be goo

Graphics output from Haskell as eps

2003-02-17 Thread Sarah Thompson
Hi all, Has anyone done much work on outputting graphics in eps format directly from Haskell? My intention is to be able to generate publication quality diagrams for inclusion in TeX/LaTeX documents, without the size or quality penalties of using bitmaps. I want to write an automatic circuit visu

Re: GHC and C++ (was RE: Creating COM objects and passing out pointers to them via a COM interface)

2003-02-04 Thread Sarah Thompson
I'm replying to two threads at the same time and cross posting my reply, because they are very relevant to each other. I'm sorry if anyone here ends up seeing this more than once as a consequence. [s] -- > Sarah > > Did you get this problem sorted out? Not directly. I ended up building an 'o

Creating COM objects and passing out pointers to them via a COM interface

2003-01-24 Thread Sarah Thompson
Hi again, A slightly harder problem this time. I want to implement something that looks something like the Microsoft XML parser. This is a very COM heavy contraption that provides an interface that looks to client applications like a tree of COM objects that reflects the internal structure of an X

RE: Exception handling in GHC

2003-01-24 Thread Sarah Thompson
> Your COM wrapper code probably behaves differently because the error is > not evoked at the very top level. Note that `seq` (and hence ($!)) only > force evaluation to "weak head normal form", which essentially means only > enough to determine the top-level constructor. You may need to evaluate

RE: Exception handling in GHC

2003-01-24 Thread Sarah Thompson
I've noticed some interesting behaviour: Prelude Control.Exception> try (return (error "e")) Prelude Control.Exception> it Right *** Exception: e It would appear that when the result of this function is evaluated, the exception fires during evaluation, after the try is out of scope. I suppose it

Exeption handling in GHC

2003-01-24 Thread Sarah Thompson
Hi all, I'm trying to get exception handling working in GHC, but don't seem to be able to make it work. Am I likely to be missing a compiler switch, or something? Cutting things down to basics, I'd have thought that the following expression (typed at the ghci command prompt) should work:

Handling error in production code

2003-01-24 Thread Sarah Thompson
What is the best way to handle error in production code? I have successfully built a COM object (many thanks Sigbjorn!!!), which works fine. The only hassle is that an error being thrown causes the program using the COM object to hard terminate. This is clearly not desirable, especially since pars

RE: Stupid questions...

2003-01-23 Thread Sarah Thompson
> I need to convert Ints to Strings and vice-versa. What's the best > way to do > this? I've not found library functions for this. Read and Show. Hmm... should have tried that before posting. :) My second question about integer division still stands, however. Thanks, Sarah _

Stupid questions...

2003-01-23 Thread Sarah Thompson
ibrary functions for this. Second question: Using division over integers. I appreciate that a division operator with integers as arguments can not be guaranteed to return an exact integer result. However, if I *do* want to do integer division, how should I do it? Is floor(a/b) appropr