Re: rts/Printer.c

2002-03-19 Thread Alastair David Reid
My question is: should I implement it through the FFI or as a primitive ala primops.txt? Perhaps they amount to much the same thing. I'd make it a primop if there were some really unusual strictness issues involved or, if I wanted to eliminate all overhead, as in integer addition or if the

Re: question about concurrency implementation

2002-03-18 Thread Alastair David Reid
I'm curious about the implementation of Concurrent Haskell in GHC and Hugs. Hugs' implementation of concurrency is non-preemptive wherease GHC's implementation is preemptive (or almost preemptive) as described by Simon. Does access to values possibly shared among threads cost the same in

Re: partial application

2002-03-18 Thread Alastair David Reid
Is there a reason why partial application cannot be applied in arbitrary order? Was it a technical difficulty in the design of Haskell? Or is it just following beta reduction rigorously? Haskell doesn't dictate any particular evaluation order. If you look at the name of the Haskell report,

Re: HGL ang GHC on Win32

2002-03-14 Thread Alastair David Reid
[mailing list trimmed] Thanks Simon, Explanation of why GreenCard generates that code attached. Briefly, GreenCard has always marshalled Word8 as a Word32 (and so has Hugs). I'm wondering if a recent change in GHC or in how Win32 is compiled might have changed the way that Word32 is being

Re: (no subject)

2002-03-14 Thread Alastair David Reid
[EMAIL PROTECTED] writes: I am a student who study a computer programing. I want to have Haskell software to study . However, it is very hard to get the Haskell . and I hope you give me the way to get the Heskell. If you mail me to show the way to get the Heskell , I would appreciate your

Re: Hugs plugin, Haskell Browser

2002-03-13 Thread Alastair David Reid
Is there something like a Hugs plugin for Netscape? We used to have one at Yale. Can't remember what happened to it so I'm adding John Peterson to the address list in case he can remember. -- Alastair ReidReid Consulting (UK) Ltd ___

Re: HGL ang GHC on Win32

2002-03-12 Thread Alastair David Reid
When I compile a program using GHC 5.02.2 on Windows 200 using HGL, I don't have GHC installed on my Windows partition (nor space for it, I suspect) so I'll ask some questions and hope they suggest an answer. Does it work ok using Hugs and HGL? Sigbjorn Finne did a great job of packaging

Re: HGL ang GHC on Win32

2002-03-12 Thread Alastair David Reid
When I compile a program using GHC 5.02.2 on Windows 200 using HGL, I don't have GHC installed on my Windows partition (nor space for it, I suspect) so I'll ask some questions and hope they suggest an answer. Does it work ok using Hugs and HGL? Sigbjorn Finne did a great job of packaging

Re: Isn't this tail recursive?

2002-03-11 Thread Alastair David Reid
It would be possible to do strict evaluation in the case that the suspended computation is known to take a small bounded amount of time and space and can't fail - GHC doesn't do this, but we've wondered about it from time to time. I wonder if this would have the side-effect of making

Re: Behavior of fromInteger on out-of-range arguments

2002-02-26 Thread Alastair David Reid
Dean Herington: I strongly prefer that that behavior _not_ be provision of any normal Int value. I agree. I think a operation to let you examine the (possibly) underlying 2s complement representation without raising an exception should be quite separate from the operation to convert between

Re: How to write a lazy variant ?

2001-12-04 Thread Alastair David Reid
I hate to followup to myself, but looks like I had to. I really was too tired and lazy version could be obtained by simple use of accumulator: Are you _sure_ that's all it takes? I was expecting that you'd need 'unsafeInterleaveIO'. (This function is used to implement hGetContents. Some

Re: Possible bug/omission in Numeric library?

2001-11-29 Thread Alastair David Reid
Also, GHC's NumExts has doubleToFloat :: Double - Float floatToDouble :: Float - Double Q2: If we are going to run round adding functions to Numeric, should we add those too? It's hard to know where to stop... but if that conversion is what you want to do, H98 doesn't give a good

Re: Global variables

2001-11-29 Thread Alastair David Reid
Hello, I am interested in using global variables (in GHC). I need a variable to store list of Integers to store temporary results. I have been reading the module MVar, but I wonder if there is an alternative way of doing it. I have already implemented my function using an auxiliar

Re: Casting dynamic values

2001-11-27 Thread Alastair David Reid
George Russell [EMAIL PROTECTED] writes: cast :: (Typeable a,Typeable b) = a - Maybe b cast = fromDynamic . toDyn My question is: is this the most efficient way of doing it, or is there a better way? I think I'd do it that way. toDyn and fromDynamic are both pretty simple functions.

Re: Building GHC 5.02 on Solaris x86

2001-11-02 Thread Alastair David Reid
So, bringing back the solution of having manually written C wrapper functions which platform-independent Haskell source files will call out to, would be preferable (in short, avoid the use of hsc2hs *or any other extra tool* alltogether). I'm willing to make the necessary changes. You

Re: readFile close behaviour

2001-10-11 Thread Alastair David Reid
Simon Marlow [EMAIL PROTECTED] writes: The upshot is that while GHC might notice that you have dropped a Handle, another implementation which doesn't do black holing, stack stubbing, strictness analysis, GC evaluation of selector thunks or any of the other tricks we do to avoid space leaks

Re: enormous executable

2001-10-04 Thread Alastair David Reid
Simon (talking about using -ffunction-sections) And there's bound to be some complication due to the assumptions we make in the RTS about the relative ordering of code/data. Sounds like the mangler should do the function section magic. Assuming the mangler understands where section

Re: Prelude and (:) and []((:), []) bugs?

2001-09-20 Thread Alastair David Reid
Ah, I forgot that you can't export a constructor on its own. You can't? I probably knew this once but looking at it now, it seems kinda surprising. Haskell's module system is supposed to be just namespace control --nothing more-- so why is it preventing me from doing something which is

Re: unsafePtrCompare, anybody?

2001-09-18 Thread Alastair David Reid
Leon Smith [EMAIL PROTECTED] writes: My intuition says that none of the side-effects in my implementation are visible from the abstract level of the module. However, the use of unsafePerformIO certainly modifies the behaviour of the module. Here's a simple test you can apply: Can you

Re: Tab \t character behaviour in (Win)hugs/ghc

2001-09-18 Thread Alastair David Reid
Rijk-Jan van Haaften [EMAIL PROTECTED]: What does the language definition say about [tabs]? Sigbjorn: Nothing at all, I believe, but the convention is [...] The Haskell 1.4 report says what is meant to happen (section 1.5) (which was to follow the convention). The Haskell 98 report omits

Re: Application letters at the Haskell workshop: suggestion

2001-09-17 Thread Alastair David Reid
Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] writes: Parsec [uses some variant of the error monad] and similar things. It tries to generate reasonable messages of the form expecting foo, found bar or unexpected bar annotated with source position, making use of labels of higher level syntactic

Re: The future of Haskell discussion

2001-09-14 Thread Alastair David Reid
If the GUI is based on the IO monad, then it doesn't seem like there is a lot of advantage to doing it in Haskell. It seems like a better idea to use a more natural language for IO and make RPC/interproc calls to a haskell server to get stuff done. In other words, if you use the IO monad,

Re: Application letters at the Haskell workshop: suggestion

2001-09-13 Thread Alastair David Reid
Quick reply to just one point (more later, I hope): Also, do these books have good coverage of things like existential types, functional dependencies, other experimental-but-apparently-crucial features that are hard to find documentation for? I consider myself a fairly hardcore

Re: Application letters at the Haskell workshop: suggestion

2001-09-12 Thread Alastair David Reid
I think there's a lot of truth in all you said in your message and I make the following comment merely as a point of information. I think I speak for the majority of 'industrial' programmers when I say Haskell is a very difficult language to approach. I believe a great deal of this

Re: GHC FFI Return Type Bug

2001-09-10 Thread Alastair David Reid
Thanks. I think the decision here is to do the safe thing and mask the return results ourselves, since it's only one extra insn. This won't make it into 5.02, tho. So GHC's Int/Word implementation is different from Hugs'? Hugs represents Word8 (say) by a 32 bit int but doesn't guarantee

Typo in type error

2001-08-16 Thread Alastair David Reid
The with [(oenv, oenv), (benv, benv)] right at the end of this error message should be displayed in legal Haskell syntax such as with ?benv=benv; ?oenv=oenv ../TcUnits.hs:160: Could not deduce `?cenv :: ClassEnv' from the context () Probable fix: Add `?cenv :: ClassEnv'

Re: series

2001-08-16 Thread Alastair David Reid
hello, i just want to ask a simple question: does somebody have or know where to find a haskell program that calculates the number e, that is the list of infinite digits? Hugs includes such a function in its demos. Look at eFactBase in the file hugs98/demos/Examples.hs There's a lot of other

Re: Bindings and Space leaks

2001-07-04 Thread Alastair David Reid
Janis Voigtlaender [EMAIL PROTECTED] writes: 2. In a '93 paper, Jan Sparud describes an implementation technique for avoiding space leaks when tuples are returned as function result, and the values accessed by pattern matching in bindings. The paper says this technique (of shorcircuiting all

Re: Another space leak question

2001-07-02 Thread Alastair David Reid
[Metacomment: the only way to really answer your question is to use one of the debugging tools mentioned previously in the space leak threads. For large programs, anything else is just a list of guesses.] I think the space leak lies in the code you did not show us. What does step look like?

Re: Some good-hearted criticism

2001-06-27 Thread Alastair David Reid
Juan Carlos Arevalo Baeza [EMAIL PROTECTED] writes: Hmmm... I guess I'll have to look more closely into the Hugs documentation. I wasn't aware that it had profiling in it too... O:-) And, looking closer, this option is not mentioned anywhere, and it rejects the option. Hmmm... I have

Re: Some good-hearted criticism

2001-06-27 Thread Alastair David Reid
Juan Carlos Arevalo Baeza [EMAIL PROTECTED] writes: Seems to me like Haskell could do with a better list primitive, where you can pattern-match on either side (with two constructors, so to speak). It does have better lists - Chris Okasaki's Edison library provides a wholbunch of variants

Re: ghc_extra_opts in package

2001-06-18 Thread Alastair David Reid
[Hugs maintainer (Johan) added to list] Writing about providing compiler-specific flags in package descriptions, Simon Marlow [EMAIL PROTECTED] writes: According to the Principle of Least Astonishment, we should force the user to add any extra options himself, because if '-package wibble'

Re: Empty Datatypes in GHC 5?

2001-06-07 Thread Alastair David Reid
Ashley Yakeley [EMAIL PROTECTED] writes: data Zero; data Succ n; Unfortunately this is contrary to the Haskell Report. Nevertheless, Hugs allows it. But GHC, apparently, does not. Note that Hugs allows it principally so that we can write the following in the Prelude: data Float data

Re: Advantages of Paper

2001-06-05 Thread Alastair David Reid
I find it therefore of concern that many crucial Haskell documents, including the standard and, for example, the various Glasgow Haskell manuals, are only available online. My printed copy of the Haskell 98 report is numbered: YaleU/DCS/RR-1106 Copies can no doubt be obtained from the

Re: GHC core representation

2001-06-04 Thread Alastair David Reid
[This is in reply to Andrew Tolmach's mail to the Haskell list. He asked that replies should be sent to ghc-users.] Many months after the topic was first raised, there is finally a draft document describing a formal external syntax for GHC's Core intermediate language. Wow! This is very

Re: Haskell 98 Report

2001-05-31 Thread Alastair David Reid
Fergus Henderson [EMAIL PROTECTED] writes: (It would be good for someone, perhaps Simon P-J., to keep a list of issues like this which have been left out of Haskell 98 due to backwards compatibility concerns, so that they don't get forgotten about when it comes to time for the next version.)