Re: readFile close behaviour

2001-10-05 Thread Malcolm Wallace
% cat manyfiles.hs main :: IO () main = do readFile manyfiles.hs main % ghc -o manyfiles manyfiles.hs % ./manyfiles Fail: resource exhausted Action: openFile Reason: process file table full File: manyfiles.hs In fact nhc98 behaves the same, but hugs seems to do better

ghc-pkg

2001-10-02 Thread Malcolm Wallace
I notice that the method for detecting the configuration of ghc (for building 'hmake') no longer works with 5.02. This must be the most unstable part of ghc - I've had to change it at 4.06, 4.08, 5.00, and now 5.02 as well! ghc-pkg-5.00 --show-package std --field import_dirs

Re: Haskell 98 Report: October release

2001-10-02 Thread Malcolm Wallace
the main things I've done this time is to * revise yet again the wording about export lists Two of the changes to Export Decls (Section 5.2) now conflict with each other. [Oct 2001] The form `module M' abbreviates the set of all entities whose unqualified name, e, is in scope, and

ANNOUNCE: Hat and nhc98 version 1.08

2001-09-25 Thread Malcolm Wallace
information about Hat is available at http://www.cs.york.ac.uk/fp/hat/ Happy tracing, The ART team in York (Malcolm Wallace, Olaf Chitil, Thorsten Brehm, Colin Runciman) ___ Haskell mailing list [EMAIL PROTECTED] http

Re: Literate scripts not handled correctly

2001-09-18 Thread Malcolm Wallace
My understanding is that the following script: - cut here - foo :: Int - Int foo _ = 2 \begin{code} bar :: Int - Int bar _ = 1 \end{code} - cut here - should be valid and define foo and bar (although the report does say It is not advisable to mix these

Re: Erroneous warning

2001-09-17 Thread Malcolm Wallace
foo :: Int - Int foo (i+1) = i foo 0 = -10 Q.lhs:5: Warning: Pattern match(es) are overlapped in the definition of function `foo': foo 0 = ... | This is acceptbale behaviour, since the first equation can match with i = -1. | The type is Int, not Nat. No, it is not

Re: help needed for adding isWHNF primop to 5.00.2

2001-08-01 Thread Malcolm Wallace
Andy writes: What I want is gdb for GHC :-) Perhaps another build (like profiling vs optimizer), and when you press ^C, the ghcdb prompt comes up :-) Hey, we already have pretty-much exactly that in nhc98. :-) I wonder if the Cost Center Stack idea can be combined some debugging concepts,

RE: help needed for adding isWHNF primop to 5.00.2

2001-07-31 Thread Malcolm Wallace
I know that Andy Gill was also interested in having similar facilities, perhaps he can help out. I wonder if Andy is reading this? Possibly there are other people around who are also interested in this. I think the HAT people at NHC headquarters are also interested in these things.

Re: infelicity in module imports

2001-07-05 Thread Malcolm Wallace
In short, an import *always* brings the entire *qualified* set of names into scope. Hiding and revealing applies only to unqualified names. I agree with SimonM that this is not what the Report says. At one time it may have done, but careful reading shows that only the qualified names for

infelicity in module imports

2001-07-04 Thread Malcolm Wallace
I was considering submitting this as a bug report in the Haskell'98 definition, but I don't know whether that is the appropriate designation or not. In any case, I think it is probably caused by a hang-over from a previous version of Haskell that never caught up with the newer features added in

Re: infelicity in module imports

2001-07-04 Thread Malcolm Wallace
| Currently, you are permitted to write | | import A hiding (f) | import B as A (f) | | and this means that everything exported from module A is visible, | with the exception that function `f' is overridden by a different | definition from module B. Here, a reference to `A.f'

Re: Some good-hearted criticism (Was: Biggest Haskell unit in the world)

2001-06-26 Thread Malcolm Wallace
Second, debugging tools. So far, I haven't been able to figure out why my program (a parser for C++ comments and strings) generates stack overflows. Nothing I've been able to think up has been of any help. Neither has the suggestions I got from the mailing list. GHC is supposed to have

Re: Why is there a space leak here? (fwd)

2001-06-07 Thread Malcolm Wallace
Hi Claus, I've had a look at this example in GHood, and you are right, nhc98 does seem to create several copies of v-in. import Observe foo1 m = take m (observe v-out v) where v = 1 : concat (map triple (observe v-in v)) triple x = [x,x,x] main = printO $ (foo1

Re: Small Bug in Xml2Haskell?!

2001-05-30 Thread Malcolm Wallace
I discovered a problem with Xml2Haskell which is possibly a (small) bug. You are right. Thanks for the report. I have made a patch available atftp://ftp.cs.york.ac.uk/pub/haskell/HaXml/patch-1.02-dtdtohaskell By the way, | Here's the DTD: | | !DOCTYPE Root [ | !ELEMENT Root (

Re: Haskell 98 Report

2001-05-30 Thread Malcolm Wallace
| It could be generalized to the following (no change to the definition): | | deleteBy :: (a - b - Bool) - a - [b] - [b] Indeed, and deleteFirstsBy :: (a - b - Bool) - [b] - [a] - [b] and intersectBy :: (a - b - Bool) - [a] - [b] - [a] Although curiously, its dual

RE: Functional programming in Python

2001-05-28 Thread Malcolm Wallace
It seems that right-associativity is so intuitive that even the person proposing it doesn't get it right. :-) Partial applications are a particular problem: Haskell Non-Haskell Left Associative Right Associative From

RE: Building Programs

2001-05-24 Thread Malcolm Wallace
What's the recommended way of building a system consisting of many Haskell modules? Should I use hmake, make or is there some other preferred mechanism in the Haskell world? As Simon PJ already mentioned, hmake is entirely platform independent, so if there is any likelihood that you may need

ANNOUNCE: nhc98 1.04 and Hat 1.04

2001-05-21 Thread Malcolm Wallace
, Malcolm Wallace, Thorsten Brehm, Phil Hassall) ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: trouble with make install on darwin

2001-04-30 Thread Malcolm Wallace
Thomas Hallock [EMAIL PROTECTED] gets the following error on MacOS X when trying to build nhc98 with ghc. I think this must either be a bug in ghc, or some incompatibility between ghc and zsh. Bug report forwarded to the glasgow-haskell-bugs list for comments from the ghc folks. I get this

Re: Readline dependency

2001-04-23 Thread Malcolm Wallace
of hmake interactive for some time, and is also attached below if you want to steal and modify it. Regards, Malcolm cut here {- Either use ReadLine, or a dumb replacement. -- Copyright Malcolm Wallace, 2000. -- Open source licensed under the same terms as nhc98. -} module SimpleLineEditor

RE: help wanted with type error message

2001-04-05 Thread Malcolm Wallace
In that case you need an existential type (not Haskell 98), which GHC and Hugs support thus: data Row a = forall f. Formula f = Row (f a, Weight) And incidentally, nhc98 also supports this particular extension with this syntax. (Hbc supports it too, but with a slightly different

Re: A Hugs bytecode interpreter

2001-04-02 Thread Malcolm Wallace
There is nhc98, of course, but it is somewhat bulky for the purposes I have in mind. I am looking for something small that would compile to 16-bit code that would run in 64K code + 64K data. It's a shame that nhc98 doesn't fit your requirements, since it is specifically designed for creating

RE: Difficulties compiling hmake / HaXml

2001-03-29 Thread Malcolm Wallace
I tried to change the "configure" file as you described -- and after "./configure" and "make" I still get the same error message Apologies. My patch (and the description of the reason why 'hmake' needed it) were completely bogus. That will teach me to fix bugs from memory rather than looking

Re: AW: Difficulties compiling hmake / HaXml

2001-03-28 Thread Malcolm Wallace
Okay, I tried to ignore the error and went on with "make install" (after "./configure" and "make"). However, again an error message appears (see above), and there is no .exe output. What can I do about this now? * Either try the hack to READLINE="" in lib/ix86-CYGWIN_NT-4.0/config,

Re: Question concerning ftp and GHC binaries for HP-UX

2001-03-23 Thread Malcolm Wallace
I'm very glad to know if there exists somebody who will aid me or play together with me over 64-bit ghc for 64-bit HPUXes. Should I attack the problem from HBC or nhc98? The last kisstion: Can I build ghc from Hugs Ghc can only be built by itself, not with any other Haskell system. The only

Re: HaXml (was: Re: Welcome to the Haskell mailing list)

2001-03-22 Thread Malcolm Wallace
im trying to have haxml lib running with hugs and had the following problem 1) under win, quite an issue to tun the cpp stuff. did it under linux, (for info) Thanks for the report. I'll think some more about how to package HaXml to make things easier for Hugs users. 2) then i had a

Re: Pattern guards vs. case

2001-03-01 Thread Malcolm Wallace
runRandom last max num | num 1 = runRandom (fst new) max (num-1) | otherwise = snd new What's the difference between the pipe-syntax, and a case statement, i.e. writing the function as runRandom last max num = case num of 1 - runRandom otherwise - snd new

Re: The Do-Let-Braces problem

2001-02-15 Thread Malcolm Wallace
Mark Utting writes: fb::IO () fb = do { putStr "Enter Data: "; line - getLine; let line2 = line; putStr line2; } ERROR "f.hs" (line 13): Syntax error in definition (unexpected symbol "putStr") I find it hard to determine

Re: Revised numerical prelude, version 0.02

2001-02-15 Thread Malcolm Wallace
Dylan Thurston writes: I'd like to start using something like this in my programs. What are the chances that the usability issues will be addressed? (The main one is all the fromInteger's, I think.) Have you tried using your alternative Prelude with nhc98? Offhand, I couldn't be certain

4.08.2 fails to install on sparc

2001-02-13 Thread Malcolm Wallace
I downloaded the 4.08.2 binary bundle for sparc, and did ./configure make install For some reason it appears to want to rebuild lots of things. Anyway, after some time, I get ../../ghc/driver/ghc-inplace -recomp -cpp -optC-fglasgow-exts -fvia-C -Rghc-timing -I../../ghc/includes

Re: 4.08.2 fails to install on sparc

2001-02-13 Thread Malcolm Wallace
I don't understand this. Since the binary bundle does not include any source code, how can it start to compile bits of itself at installation time? That puzzled me too. It's egg-on-face time. (But whose face? :-) After unbundling the binary package, I cd'd to the fptools directory, just

GHC-4.08.2

2001-02-06 Thread Malcolm Wallace
The download links on http://www.mirror.ac.uk/sites/www.haskell.org/ghc/ for the new GHC 4.08.2 have somewhat (ahem) strange referents. (The RedHat 6 binary package gives me a picture of Haskell B Curry, the RH6 profiling package gives me a .dvi file of the dynamic semantics of the language,

Re: GHC-4.08.2

2001-02-06 Thread Malcolm Wallace
The original haskell.org site seems ok, just mirror.ac.uk is broken. Oops, retract that. The RedHat 6 packages all seem to be 4.08.1, not the advertised 4.08.2. Regards, Malcolm ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED]

Re: {-# LINE 100 Foo.hs #-} vs. # 100 Foo.hs

2001-01-16 Thread Malcolm Wallace
Here is what is currently supported: {-# LINE 100 "Foo.hs #-} |# 100 "Foo.hs" I recently discovered that some of the GHC toolset actually generates and recognises {-# LINE 100 "Foo.hs -} which is somewhere in between a comment and a pragma. Has this been fixed

RE: Change sigTTOU/TTIN to IGNORE by default

2001-01-15 Thread Malcolm Wallace
But we're not changing any of the terminal flags, simply setting the same ones again. I'm totally stumped! Any ideas, anyone? According to the manual page, tcgetattr() ... This function may be invoked from a background process; however, the terminal

Haskell pattern matching too strict?

2001-01-09 Thread Malcolm Wallace
-- broken fragment instance (Typeable a, Typeable b) = Typeable (a,b) where typeOf (x,y) = "("++(typeOf x)++ ","++(typeOf y)++")" -- Is this too strict? It never uses the tuple or its arguments yet tries to construct the tuple anyway. Yes, this is too strict, but no, Haskell is

Re: pattern matching overlap

2000-12-18 Thread Malcolm Wallace
The program shown below elicits a complaint about pattern overlap for doMem1. I don't expect any complaint. doMem1 (NUMOP ADD e1 (CONST i)) = 1 doMem1 (NUMOP ADD (LREF lab) (CONST i)) = 4 doMem1 (NUMOP SUB e1 (CONST i)) = 3 doMem1 (NUMOP SUB (LREF lab) (CONST i)) = 6 I

FFI problems?

2000-12-18 Thread Malcolm Wallace
I just tried to compile this: module Fib where foreign export fib :: Int - Int fib 0 = 1 fib 1 = 1 fib n = fib (n-1) + fib (n-2) using GHC 4.08 under Linux, $ ghc -c Fib.hs -fglasgow-exts panic! (the `impossible' happened): tcLookupGlobalValue: THIS.PrelIOBase.returnIO{-0B,s-}

a trap for the unwary

2000-12-01 Thread Malcolm Wallace
Today, I thought I had discovered a bug in ghc. Then I tried hbc and Hugs, and they also rejected my program with the same error. nhc98 alone accepts it without complaint. I looked up the Report, and it seems that the program is indeed incorrect. Quick quiz: without running this through a

Re: a trap for the unwary

2000-12-01 Thread Malcolm Wallace
f x = y where y | isSpace x = True y | otherwise = False-- ** The problem line? Correct. Here y is a pattern binding, and multiple pattern bindings of the same variable are not permitted. f x = y () where y _ | isSpace x = True y _ | otherwise = False

file suffixes

2000-11-30 Thread Malcolm Wallace
I recall that at one point GHC came with "bundles", built in "ways", like profiling, parallel, tickyticky, etc.. There was also some filename-mangling scheme for distinguishing .hi interface and .o object files from the different bundles. My question is, what was that filename-mangling scheme?

ANNOUNCE: HaXml 1.00

2000-11-16 Thread Malcolm Wallace
We are pleased to announce HaXml release 1.00 HaXml is a library enabling the use of Haskell and XML together, together with several auxiliary tools for useful XML jobs. Fuller details are on the web page. What's new

Re: no non-typevariable in instance declarations

2000-11-15 Thread Malcolm Wallace
(By the way, is there any plans to implement multiparameter type classes and instance overlapping in NHC98?) No-one at York has any current plans to implement MPTC or instance overlapping in nhc98. However, other people would be most welcome to do so if they wished. Regards, Malcolm

Re: no non-typevariable in instance declarations

2000-11-14 Thread Malcolm Wallace
class C a where ty :: a - String instance (Num a) = C a where ty _ = "NUM" instance C Integer where ty _ = "Integer" Why GHC and NHC98 are more restrictive than Hugs? The instances for (Num a= a) and Integer overlap, and are therefore forbidden by Haskell'98. Hugs allows

Re: Translations

2000-11-07 Thread Malcolm Wallace
At York, Tatsuru Matsushita's DPhil thesis "On the power of declarative programming", includes a translation scheme between logic programs in Prolog and functional programs in Haskell. His thesis is available at ftp://ftp.cs.york.ac.uk/pub/tatsuru/thesis.ps.gz The translation scheme is also

Re: getContents

2000-10-26 Thread Malcolm Wallace
contents - hGetContents handle seq (last contents) (hClose handle) vs. contents - hGetContents handle hClose handle However I looked at the manual and it seems that hClose should force the whole of contents to be read anyway. If some manual says this, it is wrong.

ANNOUNCE: hmake version 2.00

2000-09-15 Thread Malcolm Wallace
, Malcolm Wallace

ANNOUNCE: nhc98 version 1.00

2000-09-15 Thread Malcolm Wallace
, if you do already have a Haskell compiler, the configuration process will detect it and use it. http://www.cs.york.ac.uk/fp/nhc98/ Binary distributions packages will appear on the same website in due course. Regards, Malcolm Wallace Colin Runciman Olaf Chitil P.S. We

Re: Installing GHC from source only

2000-09-13 Thread Malcolm Wallace
The problem with ghc is - as it is written in Haskell - that you have the chicken/egg problem if you install on a machine that hasn't got a Haskell compiler yet. Actually, it is worse than that. Ghc is written in *non-standard* Haskell, so you can't build it with just any Haskell compiler,

foreign import bug still in 4.08

2000-07-12 Thread Malcolm Wallace
The ``foreign import'' bug for Float types is still present in ghc-4.08. (I think Floats are being silently promoted to Doubles, which as far as I can tell is wrong - this is a difference between KR1 and ANSI C.) Regards, Malcolm Main.hs module Main where foreign import floatToInt

RE: foreign import bug still in 4.08

2000-07-12 Thread Malcolm Wallace
| The ``foreign import'' bug for Float types is still present | in ghc-4.08. This bug is definitely present in the native code route. It would be good to know if the bug exists on the via-C route. If you recompile with -fvia-C (perhaps check with -v to be sure it really does go via C),

RE: foreign import bug still in 4.08

2000-07-12 Thread Malcolm Wallace
Going via C is fine, as long as you -#include the relevant prototype for the C function you're calling. Otherwise the C compiler automatically promotes the arguments/result to doubles and you're hosed. There's been a great deal of discussion on the FFI list (as I'm sure you've seen) about

RE: strange Prelude.chr bug

2000-06-13 Thread Malcolm Wallace
Fail: Prelude.chr: bad argument nofib/real/compress2 fails with the same message, for us. We haven't investigated. Perhaps it's the same bug. With a quick grep through the two programs, my guess is that 'toEnum' is being specialised at type Char to an internal function 'chr', and that

Re: When is an occurrence an occurrence

2000-06-09 Thread Malcolm Wallace
Simon PJ writes: reverse :: [a] - [a] Or M.reverse :: [a] - [a] A) The unqualified form should be legal because the type signature can only refer to the 'reverse' defined in this module B) The unqualified form is ambiguous. All occurrences of 'reverse', other

Re: import List(..) ?

2000-05-15 Thread Malcolm Wallace
The good news is that ghc (4.04) does not follow the Haskell 98 report -- it accepts the following code, apparently as an extension to Haskell 98 (even without `-fglasgow-exts'): module Example(Prelude.[](..)) where import Prelude([](..)) Similarly, it also accepts

Re: Fuzzy.hs

2000-05-12 Thread Malcolm Wallace
nhc98 and ghc4.06 show a different message: Fuzzy.hs:188: Variable not in scope: `fromInt' The function "fromInt" is not part of Haskell'98. Replace its sole use with "fromIntegral", and the module compiles just fine with nhc98. Regards, Malcolm

Re: bug in foreign import (for floats)

2000-05-11 Thread Malcolm Wallace
[Thread moving to [EMAIL PROTECTED] - please follow-up there.] | It seems rather horrible to me, but I imagine the rationale is | that the primitive FFI should not be C-specific. | | Not only that: You can't dictate that all implementations of Haskell | have to use e.g. int for Int. I

bug in foreign import (for floats)

2000-05-10 Thread Malcolm Wallace
ghc-4.06 (downloaded from the ftp site; I haven't tried the current CVS version) appears to have a bug in the FFI, demonstrated by the following code using Floats. float.c int floatToInt (float fl) { union { float f; int i; } tmp; tmp.f = fl; return tmp.i; } end

Re: Binary Search Tree debugging

2000-04-18 Thread Malcolm Wallace
Assuming this isn't a homework exercise... 1) If current node is empty then this portion of tree is a BST 2) if the left subtree and right subtree's are both not empty then ... The logical negation of your second clause (which is what is picked up by the 'otherwise' clause of your code) is

RE: improving error messages

2000-04-03 Thread Malcolm Wallace
class ShowType a where showType :: a - String Or you can do what hbc has done for donkey's years and include 'showType' in Show. Incidentally, nhc98 also has had 'showType' in class Show since the year dot - only Hugs and ghc lack it. (Does anyone know why this idea didn't

RE: improving error messages

2000-03-31 Thread Malcolm Wallace
take :: Int - [a] - [a] If you want to define your own take mytake :: Show a = Int - [a] - [a] that's fine, but it's a different function. And for (head []) there's really no useful info to hand. So I'm stumped. Although you can't show the value (because there isn't one), you can

Re: improving error messages

2000-03-31 Thread Malcolm Wallace
instance ShowType a = ShowType [a] where showsType xs = ('[':) . showsType x . (']':) where ~(x:_) = xs Looks like ~(x:_) gives access to a constant instance operation on the type of an element of xs even when xs is empty. Looks like it works. But I do not understand the

FFI (Ptr a)

2000-03-28 Thread Malcolm Wallace
And Ptr is what? "type Ptr a = Addr" makes "Ptr a" the same as "Ptr b" for any a,b. But newtype Ptr a = Ptr Addr does not allow Ptr a to equal Ptr b. IMHO Haskell should allow newtypes in foreign calls (I'm only not sure if it should require the constructor to be accessible). The

Re: The return of the Void [Was: newtypes]

2000-03-17 Thread Malcolm Wallace
The Haskell report explicitly allows recursive newtype definitions. So why is it reasonable for a compiler to reject them? nhc98 rejects circular newtypes which are semantically bottom, like newtype Void = Void Void newtype A = A B newtype B = B A because it cannot find a

Re: speed and size of compiled Haskell code

2000-03-16 Thread Malcolm Wallace
I wonder if someone could tell me more about the speed and size of compiled Haskell code. E.g. if one uses GHC to compile Haskell code into native code what speed performance can be expected versus a same program written in C (Hints about the nhc compiler are welcome). Without going into

Re: Haskell 98: partition; and take,drop,splitAt

2000-03-15 Thread Malcolm Wallace
1. Marcin Kowalczyk pointed out that scanl1 and scanr1 fail on empty args, whereas they could perfectly well return [] on such arguments. Does the same apply for foldl1 and foldr1? Regards, Malcolm

missing Native?

2000-03-10 Thread Malcolm Wallace
It appears that the library Native has disappeared between 4.04 and 4.06, in the big hslibs reorganisation. Can we expect it to return, and if so, when will it come back? Regards, Malcolm (P.S. I'm mainly interested in showBytes, which is used within the nhc98 compiler. If it's not

Re: Enum instance for Ratio

2000-03-09 Thread Malcolm Wallace
Sven writes: Both GHC and Hugs have a bug in their Prelude for Ratio's Enum instance. ... The reason for this is that the default method for enumFromThenTo is used, which truncates 4%3 to 1 (same for enumFromTo). I'd say that this is a bug in the Library

HaXml stuff ...

2000-03-01 Thread Malcolm Wallace
I am trying to build the HaXML stuff and the linker (ld) is looking for an archive, gmp.a, which I don't have installed. Can anybody lead me in the right direction?? HaXml does not use the Gnu Multi-Precision library directly. This is most likely a known ghc/Linux problem. From the ghc

Re: Test case [space leak?]

2000-02-28 Thread Malcolm Wallace
Joe, Bad news from the nhc98 camp on your test cases - they don't leak in the same way! Bear in mind that different compilers produce code with different space behaviour - so some of your cases which leak in Hugs don't leak in nhc98, and vice versa. test1a constant space of ~1kb

Re: litlits in interface files

2000-02-25 Thread Malcolm Wallace
Depending on the OpenGL version there are #defines or a big enum. So the only portable way without litlits would be a small automatically generated C program that is run as part of HOpenGL's configuration process and outputs Haskell definitions or #defines for all needed constants.

Re: Importing instances without pangling Make

2000-02-25 Thread Malcolm Wallace
Suppose that B had imported C only to export it again (either by listing it in the export list, or not having any export list at all). Wrong. If B imports C and has no export list, nothing from C is re-exported, only definitions from B itself, with the single exception of C's instance decls.

Re: foreignObjToAddr

2000-02-23 Thread Malcolm Wallace
|I remember this discussion of a | so-called "special rule" for ForeignObjs from previously, and I still | don't understand why it is "special" rather than the obvious and only | way to do things. | | In case of a tail call to a C routine, ghc could

Re: parse error in Hugs98 library

2000-02-04 Thread Malcolm Wallace
Sven writes: Does ghc have a problem with the 'primitive' declaration? [...] Exactly. In GHC (and probably already in NHC, too. Malcolm?) you have to write foreign import unsafe getRandomSeed :: IO Int Yes, since 1999-11-19, nhc98 also supports the new FFI. Regards, Malcolm

IOExts

2000-01-31 Thread Malcolm Wallace
I am starting a one-person (and it might stay that way :-) campaign to change the name of the library module IOExts to something more meaningful and pronounceable. Personally, I hate the name IOExts with a vehement loathing, but I guess I probably have to convince quite a number of other people

RE: read???OffAddr is broken

2000-01-28 Thread Malcolm Wallace
Sigh. I guess we need real IO versions of readStuffOffAddr. That means adding another 9 primops, taking the total to 260 :-( Am I not right in thinking that read/writeStuffOffAddr is now obsolete anyway? Looking at Sven's FFI proposal, all the variations are now subsumed under the Storable

RE: live display of heap usage

2000-01-06 Thread Malcolm Wallace
Johannes: i am looking for a simple patch to some Haskell runtime system so that it would display the heap *while* the program is running. like, opening an X window and mapping heap cell types to pixel colours. Julian: I seem to remember that such a thing was present in at least an early

ANNOUNCE: hmake version 1.6

1999-12-08 Thread Malcolm Wallace
We are pleased to announce version 1.6 of hmake, the compilation management tool for Haskell programs. http://www.cs.york.ac.uk/fp/hmake/ What's new - * The automatic configuration now detects which Haskell compilers are available and sets things up to use them. There is now no

Re: Default declarations

1999-11-02 Thread Malcolm Wallace
Sven Panne wrote: The Haskell 98 report, section 4.3.4 states: [...] In situations where an ambiguous type is discovered, an ambiguous type variable is defaultable if at least one of its classes is a numeric class (that is, Num or a subclass of Num) and if all of its classes

Re: Xtract with hugs and Haskell implementation inconsistency

1999-10-11 Thread Malcolm Wallace
| -From ParseSTXml.hs | #define PARSEARG(tok) P (\st inp - case inp of { \ | ((p,tok n):ts) - [(n,st,ts)]; \ | ts - [] } ) | name :: Parser SymTab Token Name | name = PARSEARG(TokName) | |

RE: Confusing error message in case of layout-related syntax error

1999-09-03 Thread Malcolm Wallace
Main.hs:3: parse error on input ';' (inserted by layout) Incomplete expression on previous line or incorrect indentation of the current line. I think Manuel's suggestion is a definite improvement here. For interest, another Haskell compiler, nhc98, gives the message 4:5

Re: FFIs

1999-08-25 Thread Malcolm Wallace
There is already a Haskell FFI mailing list, [EMAIL PROTECTED] However, its most recent message was in Sept 1998, and I can't remember the subscription instructions. Can anyone enlighten us further? Regards, Malcolm

Re: Cpp symbols for Haskell 98

1999-08-24 Thread Malcolm Wallace
In brief: Define __HASKELL__=98 and __HASKELL98__ as preprocessor macros for all Haskell 98 compilers. I would like to hear from from maintainers of ghc, hbc and nhc if this can be accepted as a "de facto" standard. Please make the (small) change to the compiler or reply with a

Re: The dreaded layout rule

1999-07-30 Thread Malcolm Wallace
| How about the Carl Witty's | | do a == b == c | | does NHC handle this correctly? It matches ghc and Hugs, reporting Error when renaming: Infix operator at 2:21 is non-associative. Note that this is reported one stage *after* parsing. Because parsing of infix operators is

RE: The dreaded layout rule

1999-07-29 Thread Malcolm Wallace
Manuel Chakravarty writes: What kind of implementation did the originators of this clause envision? If the layout rule is really implemented as a filter between the scanner and the parser, it seems extremely awkward to add a dependency on the error condition of the parser - in particular,

Re: Haskell Parser in Hugs

1999-07-26 Thread Malcolm Wallace
I am wondering what is the best way (in terms of easy-to-use and easy-to-install) to use a parser for Haskell in Hugs. As far as I know the parsers by Sven Panne and Manuel Chakravarty require ghc. You could try using the parser from nhc98, written using space-efficient parser combinators.

Re: Layout rules.

1999-07-02 Thread Malcolm Wallace
| | f x = case x of | | (a,b) - case a of | | (c,d) - case b of | | (e,f) - [c,d,e,f] | | You can't be serious! This is a great example of mis-using layout to | baffle and bemuse. | | I belive he is as it is very similar to | | {- code -} = \(a,b) - | {-

Re: Layout rules.

1999-07-02 Thread Malcolm Wallace
| | mcompare x y = | | do i - x ==~ y | | if i then return EQ else do | | i - x =~ y | | if i then return LT else do | | return GT | | The reason you didn't understand it the first time is because you have |

Re: Another bug in the 98 Report?

1999-07-01 Thread Malcolm Wallace
First, a preface to my comments on layout processing: it seems to me that the purpose of the layout rules is to give the programmer FOWIM (Figure Out What I Mean) syntax. Hence, if it isn't immediately clear to a human reader what grouping is intended, then the layout rules are not helping.

Re: Another bug in the 98 Report?

1999-06-24 Thread Malcolm Wallace
Simon explains why my three examples are in fact okay: | f a b c = |defs x |where |x = ... | | That's fine, the new layout rule doesn't change the parsing of this | definition. Remember, the outer syntax level starts with the 'f', the inner | level with the 'x ='. | [... etc ...]

Another bug in the 98 Report?

1999-06-23 Thread Malcolm Wallace
Someone recently submitted a bug report to the Hugs list as follows: class C a where f :: a f = undefined is parsed by Hugs as class C a where{ f :: a ;f = undefined} which is incorrect - according to the specification of the layout rule in the Haskell 98 report, it should be parsed as class

Re: How to murder a cat

1999-06-11 Thread Malcolm Wallace
On Thu, 10 Jun 1999, Craig Dickson wrote: programming, especially lazy functional programming. If it seems desireable to re-implement a standard Unix utility in Haskell, I suggest 'make'. One could even design and implement a 'make' that would know all about Haskell modules, and parse them

make-like facilities (Was: Re: How to murder a cat)

1999-06-11 Thread Malcolm Wallace
David Tweed writes: $ gcc -M main.c Makefile $ ghc -M Main.hs Makefile $ hmake -M MyProg Makefile Since several people have pointed out the -M option for gcc I'd better explain that, for reasons of no interest to Haskell users, when tackling _C++_ it produces

Re: Portability dreams

1999-05-28 Thread Malcolm Wallace
Sven Panne writes: Using Haskell programs and libraries with different compilers and/or interpreters (or even with different versions of the same system!) is currently quite a frustrating experience. I agree. And as the current maintainer of one of the Haskell systems, I'd like to work both

Error messages (was Re: Monad question)

1999-04-23 Thread Malcolm Wallace
Reg writes: This little problem raises two challenges for compiler developers: (a) improving diagnostic messages (a perennial issue), and (b) (semi) automating error correction. In this case the diagnostic message is pretty good, except that is doesn't indicate where the IO term is or where

Re: Monad question

1999-04-22 Thread Malcolm Wallace
getDirectoryContents "." = filter (\(x:_) - x /= '.'); [65] Cannot unify types: Prelude.IO and (Prelude.[]) The problem is that `filter's result type is [a], not (IO [a]) which its use as an argument to = requires. The fix is easy: lift its result into the monad (using `return').

Re: Pleas for Change #1 #2

1999-03-30 Thread Malcolm Wallace
In Haskell, the `main' function must reside in the `Main' module. Add to this that the `Main' module must reside in a `Main' file and you have an unfortunate consequence that you can only have one `Main' function in each directory. Actually, Haskell does not insist that a module named X must

XML Haskell (Was: Re: Haskell 2 -- Dependent types?)

1999-02-17 Thread Malcolm Wallace
Alexander Jacobson [EMAIL PROTECTED] writes: * facilitate better integration with other languages/systems For example, it would be nice to be able either to generate a Haskell datatype from an XML DTD or to generate a XML DTD from a Haskell datatype. Funnily enough, that's exactly what

Haskell 98: fixity of =

1998-12-15 Thread Malcolm Wallace
Just a quickie: I see that the fixity decl of the monad operation and = changed from right associative in 1.3 to left associative in 1.4. This strikes me as a bug in 1.4 which ought to be reversed in 98. Right associativity allows: f = \x- g = \y- h x which with left associativity

Re: heap exhausted

1998-09-28 Thread Malcolm Wallace
Fergus Henderson notes: The query quoted below, about heap usage in a 5-line Haskell program, has remained unanswered for two weeks. Ok, here's an answer. Firstly, foldl' is not in the Standard Prelude, so I'm assuming the definition is as follows (from hugs 1.3): foldl' ::

<    5   6   7   8   9   10   11   >