[Haskell-cafe] Efficient or predictable Ord for Typeable

2004-11-30 Thread George Russell
Simon PJ wrote (snipped): This unfortunate observabilty of an ordering (or hash value) that is needed only for efficient finite maps, is very annoying. I wish I knew a way round it. As it is we can pick a) expose Ord/Hash, but have unpredictable results b) not have Ord/Hash, but have

[Haskell-cafe] Re: Efficient or predictable Ord for Typeable

2004-11-30 Thread George Russell
Simon Peyton-Jones wrote: The trouble is that *any* function can now deliver unpredictable results. Can I rely on the fact that foo :: Int - Int will always give the same answer given the same input. Not any more. Yes, I see what you mean. I think the strongest argument here is that it's

[Haskell-cafe] Re: ACIO versus Execution Contexts

2004-11-30 Thread George Russell
Adrian Hey wrote (snipped): I've been looking at your global variables library. Thanks. In particular, the purpose of top level - bindings IMO is *not* to provide global variables (though they could be abused this way). If you consider the example.. userInit - oneShot realInit ..the top level

Re: [Haskell-cafe] Re: Efficient or predictable Ord for Typeable

2004-11-30 Thread George Russell
(me) I suggest you implement hashTypeable :: Typeable - IO Int32 Lennart wrote (snipped) And/or mkHashTypeable :: IO (Typeable - Int32) Although this is OK, a general hash function might well need to return IO HashKey. A while back, before Data.Unique, I implemented a Unique module with

[Haskell-cafe] Re: [Haskell] Re: Global Variables and IO initializers

2004-11-29 Thread George Russell
(indexing with TypeRep) This is yet another incidence where Robert Will's ByMaps would be very useful In fact GHC at least *already* generates a unique integer for each TypeRep. A good idea, since it means comparisons can be done in unit time. Thus indexing can be done trivially using this

[Haskell-cafe] Re: Global Variables and IO initializers

2004-11-29 Thread George Russell
Benjamin wrote (snipped): Typeable would be completely safe if the only way to declare instances would be to derive them, but this is only practical if it can be done from anywhere outside the data type definition. Unfortunately this would also outlaw some legitimate uses of Typeable. In

[Haskell-cafe] Re: Yet another IO initializer: Effectful declarations and an ACIO monad

2004-11-26 Thread George Russell
[EMAIL PROTECTED] wrote: (initialising by wish) This indeed can't be proved central+affine, because it isn't. So instead, choose one of the following: 1 (Good) Indirection: declare gc - newIORef None; so that gc is a global variable holding a (Maybe GraphicsContext). Initialise the

Re: [Haskell] Real life examples

2004-11-25 Thread George Russell
John Meacham wrote (snipped): George Russell's library is precicly an invalid use of unsafePerformIO. Internally, it does the invalid unsafePerformIO (newIORef) trick which is exactly the problem we are trying to solve. hiding it in a module doesn't make it go away. Why does it matter to you

Re: [Haskell] Real life examples

2004-11-25 Thread George Russell
Lennart wrote (snipped): An easy way to prove it is to provide an equivalent implementation that uses only pure functions. As far as I remember Control.Monad.ST can be written purely. And I think the same is true for Data.Dynamic. I don't see how it can be, since you can use Data.Dynamic to

[Haskell] Re: Top-level -

2004-11-25 Thread George Russell
John Meacham wrote (snipped): recursive top level declarations are no more tricky than are normal recursive lets. Perhaps I am missing something, but surely one very important problem with - at top level is that calling for the value of something defined by - causes the corresponding action to

[Haskell-cafe] [Haskell] Re: Global Variables and IO initializers

2004-11-25 Thread George Russell
This is funny. When I got no immediate reaction from you, I started implementing it myself. I ended up with something similar. It has less features but is also a lot simpler. This is the interface: initGlobal :: Typeable a = a - IO () getGlobal :: Typeable a = IO a Your implementation is

[Haskell-cafe] Re: Yet another IO initializer: Effectful declarations and an ACIO monad

2004-11-25 Thread George Russell
Ian Stark wrote (snipped): Way back in this thread, Koen Claessen mentioned the idea of a commutative version of the IO monad for handling things with identity. That doesn't quite do it, but I have a refinement that might. The thing is to focus on IO computations that are: a) central --

[Haskell-cafe] Re: Global Variables and IO initializers

2004-11-25 Thread George Russell
Marcin wrote (snipped): I think global variables are a lot less evil if they behave as if they were dynamically scoped, like Lisp special variables. That is, there is a construct which gives the variable a new mutable binding visible in the given IO action. It's used more often than

[Haskell-cafe] Re: [Haskell] Re: Global Variables and IO initializers

2004-11-25 Thread George Russell
Benjamin Franksen wrote (snipped): Doesn't that run contrary to Adrian Hey's oneShot example/requirement? Remind me again what Adrian Hey's oneShot example/requirement is ... Well, that's indeed one major problems with global variables. Sure, you can try to solve it with multiple dictionaries,

Re: [Haskell] Real life examples

2004-11-24 Thread George Russell
Thanks John for the list of things for which you need global variables, indeed where Haskell already has global variables. I think their disadvantages are overstated. Glasgow Haskell uses them lots, as does the Workbench (I reckon about 80 or 100 times), as I suspect do most large programs that

[Haskell] Re: Global Variables and IO initializers

2004-11-24 Thread George Russell
Tomasz wrote: Without unsafePerformIO Haskell gives me many guarantees for free. With unsafePerformIO, they are no longer for free, I have to think, prove, etc. When I mistakenly give a pure function interface to an unpure function, it can affect my program in most unexpected places. I think

[Haskell] HTK

2004-11-23 Thread George Russell
I don't know if HTk is still maintained. Yes it is! It's time I put some more binary bundles up though. ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

[Haskell] Global Variables and IO initializers

2004-11-23 Thread George Russell
Thanks to the encouraging post http://www.haskell.org//pipermail/haskell/2004-November/014748.html from Benjamin Franksen, I have implemented my proposal which allows the user to define new global variables without unsafePerformIO, NOINLINE and other such horrors.

[Haskell] Re: Global Variables and IO initializers

2004-11-23 Thread George Russell
I wrote (snipped): 3) It needs no extensions to the Haskell language, and only fairly standard hierarchical libraries like Data.IORef. Lennart Augustsson wrote (snipped): It uses unsafePerformIO which is very much an extension to Haskell. :) Ben Rudiak-Gould wrote (snipped): I think by Haskell

[Haskell] Re: Parameterized Show

2004-11-16 Thread George Russell
[EMAIL PROTECTED] wrote (snipped): The running example includes an ORD class -- which is like the Ord class but can be parameterized by a comparison function, so to speak. This is precisely the problem. Rather than being able to use the existing functions, you have to haul around an extra

Re: [Haskell] Re: Parameterized Show

2004-11-16 Thread George Russell
Ben Rudiak-Gould wrote (snipped): If more than one dictionary is allowed per type, this correspondence breaks down, and all hell breaks loose as a result. We've already seen this happen with implicit parameters. In a program with implicit parameters: * Beta conversion no longer preserves

[Haskell] Re: Parameterized Show

2004-11-15 Thread George Russell
Graham Klyne wrote (snipped): I like the principle of parameterizing Show to allow for different encoding environments (indeed, I had wondered as I was writing my earlier message if the two cases were really sufficient). Indeed, in the application area that interests me (Semantic Web) it

Re: [Haskell] Re: Parameterized Show

2004-11-15 Thread George Russell
Keean Schupke wrote: Do you need a language extension at all? You can certainly do it with the existing extensions! data ShowDict a instance Show (ShowDict a) where showsPrec _ (ShowDict a) = ... I don't understand. How does that help you to, for example, use a function which requires Show

Re: [Haskell] Re: Global Variables and IO initializers

2004-11-04 Thread George Russell
John Peterson wrote (snipped): The implementer of these functions has to guarantee that the actions do not destroy the commutativity of the CIO monad. Sorry, but several of my variable initialisation actions involve things like starting up child processes or rapid exits from the program if

GHC 6.2.2 on Linux with glibc2.2

2004-11-02 Thread George Russell
I've put a compiled version of ghc6.2.2 for Linux machines still using glibc2.2 on http://www.informatik.uni-bremen.de/~ger/ghc In fact it should work on glibc2.3 as well, thanks to a minor hack from Christian Maeder. Documentation is not complete, but does at least include HTML.

Compiling faster

2004-09-23 Thread George Russell
I am responsible for a large project containing 577 Haskell library modules, with almost 120 KLOC. These modules are divided into packages. They can be compiled either (1) the old way, using ghc -M to generate dependency files, and then using make to call GHC once for each file. (2) the new way,

GHC confused by hi-boot files

2004-09-17 Thread George Russell
With both ghc6.2 and 6.2.20040915 on Linux, ghc --make cannot compile the attached files and produces a confusing error message. # ghc --make View.hs Chasing modules from: View.hs Compiling ViewType ( ./ViewType.hs, ./ViewType.o ) Compiling VersionGraphClient ( ./VersionGraphClient.hs,

Template Haskell and boot files

2004-09-17 Thread George Russell
Hello GHC bug fixers, I just sent a program which ghc --make couldn't compile but individual ghc -c commands could. Now I have just tried to work around this, using Template Haskell to use a data rather than newtype declaration for ghc6.2 Unfortunately the new code has the opposite problem! It

-fwarn-unused-imports confused by hi-boot files

2004-09-16 Thread George Russell
# ghc -fwarn-unused-imports C.hs C.hs:1: Warning: Module `A' is imported, but nothing from it is used (except perhaps instances visible in `A') However if I comment out the import of A I get ./B.hi-boot:3: tcLookup: `A.A' is not in scope In the type synonym declaration

Re: Text.ParserCombinators.Parsec requires -package text.

2004-09-08 Thread George Russell
Axel Simon wrote (snipped): But if I have two layers over gtk 1.2 and 2.0 and both use the hierarchical module system and are therefore marked as auto you would have the same problem of linking in two versions of gtk which doesn't work. Did I miss something? I presume that Simon meant that only

Re: Text.ParserCombinators.Parsec requires -package text.

2004-09-07 Thread George Russell
Simon Peyton-Jones wrote: It's documented behaviour. * import Text.ParserCombinators.Parsec will work without any -package flags, if any installed package has a module Text.ParserCombinators.Parsec. It's very tiresome adding -package flags all the time. * The link step needs -package flags,

Re: Text.ParserCombinators.Parsec requires -package text.

2004-09-07 Thread George Russell
Alastair Reid wrote (snipped): Why is it necessary to provide -package options at all? ghc-pkg knows about all the packages in your system so it could just implicitly add -package $x for every package when compiling or linking. My current need at least is to disable the lang, text, data packages

Text.ParserCombinators.Parsec requires -package text.

2004-09-06 Thread George Russell
With ghc ParsecTest.hs -o pt you get a link-time failure, because it looks as if the base package Text.ParserCombinators.Parsec depends somehow on the package text. module Main where import Text.ParserCombinators.Parsec ch = char 'C' main = do seq ch (return

Re: Text.ParserCombinators.Parsec requires -package text.

2004-09-06 Thread George Russell
Ross Paterson wrote: On Mon, Sep 06, 2004 at 12:10:09PM +0200, George Russell wrote: With ghc ParsecTest.hs -o pt you get a link-time failure, because it looks as if the base package Text.ParserCombinators.Parsec depends somehow on the package text. Try -package parsec OK, I have

Re: Marshalling Haskell String - UTF-8

2004-09-01 Thread George Russell
I have implemented code to do this which I think is better than John Meacham's, because it (a) handles all UTF8 sequences (up to 6 bytes); (b) checks for errors as UTF8 decoders are supposed to do; (c) lets you determine if there is an error without having to seq the entire list. Here is a link:

-fwarn-misc

2004-08-31 Thread George Russell
According to http://www.haskell.org/ghc/docs/latest/html/users_guide/options-sanity.html there is a GHC option -fwarn-misc. But ghc-6.2.1 doesn't seem to have it. ___ Glasgow-haskell-bugs mailing list [EMAIL PROTECTED]

Template Haskell, Haddock, -fwarn-missing-signatures don't mix

2004-08-31 Thread George Russell
Not so much a bug this as a whinge: # ghc -c TH2.hs -fwarn-missing-signatures -fglasgow-exts Loading package base ... linking ... done. Loading package haskell98 ... linking ... done. Loading package haskell-src ... linking ... done. TH2.hs:6: Warning: Definition but no type signature for `a'

-fwarn-unused-binds misses a use

2004-08-31 Thread George Russell
# ghc Unused.hs -fwarn-unused-binds -fglasgow-exts Unused.hs:10: Warning: Defined but not used: Dummy module Unused(Foo(..),ff) where class Foo (v :: (* - *) - *) where f :: v a - Int ff :: Foo v = v a - Int ff (_ :: (v :: (* - *) - *) a) = (f (error bar :: v Dummy)) data Dummy x = Dummy

[Haskell-cafe] Re: Roman Numerals and Haskell Syntax abuse

2004-07-07 Thread George Russell
Christian Maeder wrote (snipped) btw, now 127: roman=(!5);n!a|n1=|n=t=s!!(a+1):(n-t)!a|c=t=s!!(2*d):c!a|10=n!(a-1)where d=a`div`2;s=ivxlcdm;c=10^d+n;t=5^(d+1)*2^(a-d) This is amazing! When I posted my first attempt of 181 characters I thought it might be minimal.

[Haskell-cafe] Re: Roman Numerals and Haskell Syntax abuse

2004-07-06 Thread George Russell
George Russell wrote: The following declaration for a function for converting positive integers to Roman numerals is 181 characters long. Is there a shorter one? Yes, thanks to various contributors to this list, the shortest is now 148 characters!! roman=f 0;f a n|n1=|n=t!!a=s!!a:f a(n-t!!a)|n+t

Re: Glasgow Haskell on different versions of Linux

2004-06-09 Thread George Russell
Volker Stolz wrote (snipped): The functions are C89, so they should be present *somewhere* in libc anywhere. Yes, you're right. Normally isspace and friends are used as macros, but ANSI C requires them to be also available as functions so they must be exported that way. Therefore if you don't

Re: Glasgow Haskell on different versions of Linux

2004-06-08 Thread George Russell
Christian Maeder wrote: What is ctype.h good for? A good question. Its only use seems to be in ghc/rts/RtsFlags.c where it is used for functions like isdigit and isspace for decoding the RTS flags. Maybe it should be retired altogether. I'm rather puzzled how this works if ctype.h isn't there at

Re: [Haskell] Initialisation without unsafePerformIO

2004-06-03 Thread George Russell
Chung-chieh Shan wrote (snipped): The enabling technique behind our solution is to propagate values via types (literally), with the help of polymorphic recursion and higher-ranked polymorphism. The technique essentially emulates local type-class instance declarations. Configuration

[Haskell] Initialisation without unsafePerformIO

2004-06-01 Thread George Russell
What ideas do people have for getting rid of unsafePerformIO? The most common use of unsafePerformIO, for me at least, is initialisation. There *surely* must be a better way of doing this, but I haven't really seen much discussion of the topic. Here is my back-of-the-envelope suggestion for a new

Friends for --print-libdir

2004-05-14 Thread George Russell
I think there should be a GHC option --print-sharedir (or you could call it --print-datadir), corresponding to ghc --print-libdir. Thus on our system ghc --print-libdir prints out /home/linux-bkb/ghc/ghc-6.2.1/lib/ghc-6.2.1 and I would like ghc --print-sharedir to print out

Re: Windows ghc6.04

2004-05-05 Thread George Russell
Sigbjorn Finne wrote: Not sure what 2) refers to, but 1) and 3) is already in 6.2.x; no need to use the heavier-weight -threaded stuff to enable it. What I mean is a Windows version of Simon M's: http://www.haskell.org//pipermail/libraries/attachments/20040317/609414e2/Process-0001.obj or

Windows ghc6.04

2004-05-04 Thread George Russell
Is there any chance that GHC 6.04, or any GHC version in the next few months, will support the following on Windows: 1) use of native threads so that the world won't be stopped every time you wait for a character; 2) the new system-independent runProcess interface; 3) Network.Socket. (Maybe it

UTF-8 encode/decode

2004-04-27 Thread George Russell
I have implemented UTF8-encode/decode. Unlike the code someone has already posted it handles all UTF8 sequences, including those longer than 3 bytes. It also catches all illegal UTF8 sequences (such as characters encoded with a longer sequence than necessary). Here is the code.

Re: UTF-8 encode/decode

2004-04-27 Thread George Russell
David Brown wrote (snipped): What license is your code covered under? As it stands now, it is an informative example, but cannot be used by anybody. As author, I am quite happy for it to be used and modified by other people for non-commercial purposes. As far as I know my employers wouldn't any

ghc-6.2.1 incorrectly reporting duplicate instance declarations

2004-04-08 Thread George Russell
When I have a collection of files to compile and (1) I use --make to compile them together; (2) they are recursive it works the first time, but when I try to compile them the second time I get messages about bogus duplicate instance declarations, for example: Skipping GlobalRegistry (

Re: unsafePerformIO

2004-04-08 Thread George Russell
Sven Panne wrote: Huh? I'm not sure what you mean exactly, but with the help of unsafePerformIO and a pragma for clever compilers you can simulate something like a global variable in Haskell. Here an excerpt from the GLUT menu handling module: {-# NOINLINE theMenuTable #-} theMenuTable ::

Possible instances problem with ghc-6.2.1

2004-03-26 Thread George Russell
With ghc-6.2.1 compiled from source tar -xzf instances2.tar.gz cd instances2 gmake produces the message: AttributesType.hs:15: Could not deduce (Show value) from the context (AttributeValue (Radio value), HasConfigRadioButton value,

Mysterious error from ghc6.2

2004-03-11 Thread George Russell
# ghc -c FunnyError.hs FunnyError.hs:7: Couldn't match `Bool' against `[Char]' Expected type: Bool Inferred type: [Char] In the definition of `b': b x Foo = () In the definition for method `b' FunnyError.hs:9: tcLookup: `FunnyError.$dmb' is not in scope In the

Package with no dependencies causes GHC to mislay standard prelude

2004-02-27 Thread George Russell
Unpacking the attached bundle and running the following with ghc=GHC6.2 (Linux, compiled from the ghc-6.2 tag), produces the following: # cd packagesbug /home/ger/test/packagesbug # CompileBug /home/ger/test/packagesbug/package1 Chasing modules from: CompileFlags.hs Compiling CompileFlags (

ghc6.2 on Solaris

2004-02-02 Thread George Russell
I have produced, with Simon M's help, an unofficial binary release of ghc 6.2 on Solaris. This may be downloaded from http://www.informatik.uni-bremen.de/~ger/ghc/ ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED]

ghc-pkg makes unnecessary assumptions on Solaris

2004-01-29 Thread George Russell
How do you install ghc so that ghc-pkg doesn't use the Solaris linker, but instead the GNU linker which is called (here) gnu-ld? Obviously it doesn't want to use the Solaris linker since that doesn't have the --whole-archive option ghc-pkg needs. ___

[Haskell] Re: Use of tab characters in indentation-sensitive code

2004-01-26 Thread George Russell
Graham Klyne wrote (according to Wolfgang Thaller, snipped): I think that compilers should issue a warning when indentation that determines the scope of a construct is found to contain tab characters. In an ideal world, TAB characters would never have been put into ASCII, and this would be my

[Haskell] Gallopping Tab characters

2004-01-26 Thread George Russell
Andreas wrote: The most flexible but safe solution is to simply define the indentation as the sequence of indentation characters used. Two consecutive lines are indented consistently whenever one indentation is a prefix of the other. Hence you may freely mix different indentation characters,

Re: Fail: unknown exception

2004-01-06 Thread George Russell
Simon Marlow wrote: This has to be one of the most irritating ways a program can fall over. Can't the Haskell RTS try just a /little/ harder to help the poor programmer? For example by saying what sort of exception it is, and (if it's a dynamic exception) what type it has? An unknown

Re: hGetBuf (or something related) broken for 6.2 with sockets

2003-12-19 Thread George Russell
Simon Marlow wrote (snipped): BTW George: there are plenty of 6.1.xxx snapshots available - these are the 6.2 prereleases. There are, but no recent ones. What I would like to have had is a 6.2-epsilon version, not 6.1 and a bit. We don't snapshot along the STABLE branch at the moment; no

hGetBuf (or something related) broken for 6.2 with sockets

2003-12-18 Thread George Russell
I have just installed ghc6.2 on Linux. (I had to compile it from source because the binaries insist on a glibc version we don't have.) The attached module contains two functions (serverMain) and (clientMain). clientMain opens a connection (to localhost) and sends some data along it, then executes

Fail: unknown exception

2003-12-15 Thread George Russell
This has to be one of the most irritating ways a program can fall over. Can't the Haskell RTS try just a /little/ harder to help the poor programmer? For example by saying what sort of exception it is, and (if it's a dynamic exception) what type it has?

Instances which worked in ghc6.0.1 don't work for developmentsnapshot 6.3.20031201

2003-12-11 Thread George Russell
For ghc6.0.1 on Linux # ghc Test1.hs -c -fglasgow-exts -fallow-undecidable-instances -fallow-overlapping-instances # ghc Test2.hs -c -fglasgow-exts -fallow-undecidable-instances -fallow-overlapping-instances works. But for ghc6.3.20031201 the second compilation produces the message:

forkProcess type changed?

2003-12-11 Thread George Russell
For the development snapshot 6.3.20031201, System.Posix.forkProcess has the type IO () - IO System.Posix.Types.ProcessID. In 6.0.1 it has type IO () - IO (Maybe System.Posix.Types.ProcessID). Is this change intentional, and if so how are you supposed to test after the fork if this is the parent

Template Haskell panic

2003-12-10 Thread George Russell
The attached file causes a panic when compiled with ghc6.0 on Linux. # ghc -fglasgow-exts TH.hs -c ghc-6.0.1: panic! (the `impossible' happened, GHC version 6.0.1): nameModule newLen0 {- v a35 -} Please report it as a compiler bug to [EMAIL PROTECTED], or

Re: Making GHCi object files on MacOS

2003-12-10 Thread George Russell
[EMAIL PROTECTED] wrote (snipped): I don't have such duplicate definitions in my files ... producing a package with ghc-pkg -a works OK for me with Wolfgang Thaller's GHC 6.0.1 build. Is that how you're doing it, or are you trying to produce the GHCi object file manually? I was producing it

Making GHCi object files on MacOS

2003-12-09 Thread George Russell
Section 4.10.3 of the GHC manual tells me to use ld -r --whole-archive to convert a .a file into a .o file suitable for GHCi. However these options only work for GNU ld, which doesn't seem to be available on MacOS (uname -srv gives me Darwin 6.8 Darwin Kernel Version 6.8: Wed Sep 10 15:20:55

Problems with Template Haskell

2003-12-05 Thread George Russell
Template Haskell seems to be type-checking some quasi-quotes, even when they are not going to be used. This is of course a terrible nuisance, since it means it can't be used to work around interface incompatibilities between libraries for different versions of GHC (such as the recent change in

Re: Problems with Template Haskell

2003-12-05 Thread George Russell
Simon Peyton-Jones wrote (snipped): Still, in your cpp-like application, I guess your story is that the condition might evaluate to True only if the system configuration was such that bar was in scope. If the condition evaluates to False, then bar really might not be available. OK, in TH

Template Haskell and the command line

2003-12-02 Thread George Russell
Template Haskell is frightfully good and we want to get rid of cpp and use it instead, but there's one tiny problem, namely that for cpp it is possible to define variables on the command line (-DSIMON=MARLOW and so on) while with Template Haskell it doesn't seem to be. Could there be some kind of

Pestilential behaviour of gcc3.3 on Macs

2003-11-27 Thread George Russell
Yes I know this is really Apple's fault, but according to http://developer.apple.com/documentation/ReleaseNotes/DeveloperTools/GCC3.html The GCC 3.3 preprocessor inserts a new pragma, #pragma GCC set_debug_pwd, as part of the new Distributed Builds feature. (See below.) This may surprise

HTk + ghc6.01

2003-11-24 Thread George Russell
Binaries for HTk (a Haskell graphics package that uses HTk) for ghc6.01 on Linux, Solaris, Windows and FreeBSD are now available from the HTk page: http://www.informatik.uni-bremen.de/htk/ Many thanks to Guy Coleman for the FreeBSD package. ___

Vital visual notations?

2003-11-14 Thread George Russell
Martin Ewig wrote (snipped) I think that some visual notations are more readable than text (but not all). In particular, if you try to teach lambda calculus or type inference to beginners, visual notations can be extremely helpful. For some people, perhaps. I don't have a very good mind for

Incompatibilities between RPM .tar.gz versions of ghc-6.0.1

2003-11-10 Thread George Russell
It seems as if the RPM and .tar.gz versions of ghc-6.0.1 are binary incompatible. That is, a library built for one will not necessarily work on the other. For example, libHSbase.a defines the symbol GHCziRead_lvl18_closure in the .tar.gz version, which can be externally called; however in the

LD_LIBRARY_PATH, ghc and Solaris

2003-10-16 Thread George Russell
It looks like I am going to have to hack the shell script that calls ghc, because it needs to set LD_LIBRARY_PATH so that the executables can find libreadline. Would it be possible to have an option to ./configure that set a library path to be used by these scripts?

hClose non-terminating

2003-10-10 Thread George Russell
I have a problem with a handle for which hClose does not terminate. Unfortunately it's too much work for me to narrow it down now, but perhaps it can be worked out from these facts? (1) it's a socket connection. (2) it has BlockBuffering (Just 4096) set. (3) it is possible that another thread is

Re: peekCString stack overflow

2003-10-02 Thread George Russell
Actually what I really need is peekCStringLen. This function can surely avoid stack overflow by building up the result from right to left? I think for peekCString the solution might be to get the length using the C function strlen (which is more optimised than a Haskell alternative) and then call

peekCString stack overflow

2003-10-01 Thread George Russell
The following program gives me a stack overflow for a file big.tex 15 bytes long. -- Cut here -- module Main where import Foreign.C.String import Foreign.Ptr import qualified GHC.IO main = do (ptr,len) - GHC.IO.slurpFile big.tex peekCStringLen (castPtr ptr,len) return ()

Future of Haskell records

2003-09-10 Thread George Russell
I'm quite happy to have Haskell records remain the way they are. I've used ML quite a lot, which of course has records without constructors. But the problem with this is that (1) you get massive error messages; (2) there isn't a mechanism for filling in empty slots. I don't think you really gain

Segmentation fault with GHCi 6.0

2003-08-27 Thread George Russell
What is going on here? Is it already fixed in 6.1? # uname -a Linux denebola 2.4.19-4GB #2 Mon Mar 31 10:57:24 CEST 2003 i686 unknown # ghc DynExcep.hs -c -fglasgow-exts # ghci ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.0, for Haskell 98. /

Hash functions

2003-08-19 Thread George Russell
Many thanks for Data.HashTable, which I am about to use. Unfortunately I seem to need an unseemly hack because the key I want, namely ThreadId's, don't have a hash function defined, and defining one requires me to muck around with GHC internal functions. Could some more hash functions be

Unicode + Re: Reading/Writing Binary Data in Haskell

2003-07-14 Thread George Russell
Martin quoted Glynn: OTOH, existing implementations (at least GHC and Hugs) currently read and write 8-bit binary, i.e. characters 0-255 get read and written as-is and anything else breaks, and changing that would probably break a fair amount of existing code. The binary library I posted to

Re: Unicode + Re: Reading/Writing Binary Data in Haskell

2003-07-14 Thread George Russell
Glynn wrote (about my binary library, snipped): This is similar to UTF-8; however, UTF-8 is a standard format which can be read and written by a variety of other programs. If we want a mechanism for encoding arbitrary Haskell strings as octet lists, and we have a free choice as to the

GHC running out of memory, surprisingly.

2003-06-16 Thread George Russell
Yes, I know functional languages are memory hogs, but really! The following is on linux # ghci ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.0, for Hask / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \/\/ /_/\/|_| Type :?

Typesafe MRef's

2003-06-13 Thread George Russell
Keith wrote (snipped) But George Russell's implementation relied on looking up something in one map with a key obtained from another map. I thought type-safe MRefs should disallow this. However if you disallow lookup up in one map with a key from another, then Ralf Hinze's solution of putting

Re: Typesafe MRef's

2003-06-13 Thread George Russell
Keith Wansbrough wrote (snip) No, because update should not return a new key, it should update the value of the same key. In other words, let (m1,k) = insert empty A m2 = update m1 k B in lookup m2 k should give B, not A, just like with MRefs. So what does the function insert2 val1 val2

Strange ghci :def failure

2003-06-07 Thread George Russell
What is wrong here? / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.0, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \/\/ /_/\/|_| Type :? for help. Loading package base ... linking ... done. Prelude :def code (\ - do { let

RE: Typesafe MRef with a regular monad

2003-06-06 Thread George Russell
In fact I think these Typesafe MRef's are exactly equivalent to dynamic types. In other words, if you've got one, you've got the other. Ralf Hinze has just shown that if you have dynamic types you can implement Typesafe MRef. The reverse implementation would be something like data Dynamic = FM

Re: labelled fields

2003-06-05 Thread George Russell
Steffen wrote I need something like data Type = TCon String {lmtc::Maybe String} ... but this does not seem to be possible. Instead I have to waste identifiers: data Type = TCon {senseless::String,lmtc::Maybe String} ... Why? Are there any formal reasons against the above declaration?

ghc --make and missing interface files

2003-06-04 Thread George Russell
Hello all, I have a file BinaryIO. This used to import a module HGetCharHack to work around an annoying problem with ghc5.04 which meant that hGetChar was blocking unexpectedly. However I see that this problem has now been fixed in ghc6 (ta very much, Simon) so I deleted the files

Can't install ghc-6.0 on Solaris

2003-06-03 Thread George Russell
# uname -a SunOS leo 5.8 Generic_108528-18 sun4u sparc SUNW,Sun-Fire-280R # ./ghci ./ghci: /nfs/moussor/hdaume/lib/ghc-6.0/ghc-6.0: not found Also the install process failed as follows: ./mkdirhier /usr/local/pub-bkb/ghc/ghc-6.0/share/ghc-6.0/html if test -d share/html ; then cp -r share/html/*

ghc installation on Linux doesn't like CDPATH

2003-06-03 Thread George Russell
The cd command on Linux considerately prints out the name of the new directory, which it gets from the CDPATH. This has the unfortunate side-effect of breaking gmake install for ghc6.0, which uses some shell hackery of the form something like: for i in `(cd share ; find .)` where i's first value

HTk for ghc5.04.3

2003-03-12 Thread George Russell
I have created binary bundles for HTk, our Haskell interface to Tcl/Tk, for ghc5.04.3 on Linux/x86 and Windows, and put them on the download page: http://www.informatik.uni-bremen.de/htk/download/INSTALL.BINARY.html I will add FreeBSD and Solaris bundles when I can get hold of ghc5.04.3 on

Re: random permutations

2003-03-06 Thread George Russell
Andreas wrote Well, sorting is a special case of permuting, so my idea was to use the library routine List.sortBy :: (a - a - Ordering) - [a] - [a] passing it a comparison function which ignores its arguments and simply returns a random bit when invoked, e.g. permute = sortBy $ \_ _ -

Posix.getFileStatus

2003-02-28 Thread George Russell
(1) I think Posix.getFileStatus should respond to a file which isn't there with something rather more helpful than system error. For example, a No such file or directory message. (2) The logical way of spotting whether a file is actually there is the queryFile function, documented for example

FreeBSD + FIFO pipes

2003-02-19 Thread George Russell
character down each pipe; unfortunately this doesn't seem to help. Any other suggestions? By the way this is all GHC5.04.1, which seems to be the last FreeBSD version available, at least with pkg_add. Thanks. George Russell ___ Glasgow-haskell-users mailing

Re: FreeBSD + FIFO pipes

2003-02-19 Thread George Russell
Volker Stolz wrote: In local.glasgow-haskell-users, you wrote: I'm trying to get HTk to work on FreeBSD (actually FreeBSD running inside a VMware virtual machine, but I don't think that should make any difference). How HTk works is it creates a couple of pipes (readIn,writeIn) -

Re: Time since the epoch

2003-02-12 Thread George Russell
Jonathan Coxhead wrote (quoting me, snipped) Add 1 minute to 23:59:60 31st December 2003. I assume that this is a valid time and that it will be a leap second; if not choose some other year. This is complicated since we have multiple overflows. First stage you get the invalid time 23:60:60

Re: Time since the epoch

2003-02-11 Thread George Russell
Peter wrote (snipped) As far as I read ISO8601 (which also has a notation for durations) this is unspecifed :-) And as far as I read TimeExts.lhs it does some sort of rollover. My take would be to specify the behavior for adding something like a TimeDiff to a base date in a consistent manner

Re: Time since the epoch

2003-02-11 Thread George Russell
Peter Thiemann wrote: George OK, what TimeExts does, I hope, is add the appropriate amount of the appropriate George time unit (whatever it is) directly, then rely on the CalendarTime conversions to George resolve any overflows. This probably isn't very clear, George so

  1   2   3   4   5   >