ghc5.02 can't read its own interface file.
The attached interface file SimpleForm.hi provokes the following error from ghc5.02: MainsimpleFormEx.hs:6: failed to load interface for `SimpleForm': Bad interface file: /home/ger/uni/htk/toolkit/SimpleForm.hi /home/ger/uni/htk/toolkit/SimpleForm.hi:155 Interface file parse error; on input ` label ' when read in later, although it is generated by ghc5.02 itself from the attached file SimpleForm.hs with command line /usr/local/pub-bkb/ghc/ghc-latest/bin/ghc -c toolkit/SimpleForm.hs -package concurrent -package data -package net -package posix -package text -package util -package lang -i.:packer:resources:canvasitems:kernel:containers:menuitems:toolkit:components:toplevel:widgets:devices:textitems:tix:/home/ger/uni/util:/home/ger/uni/events:/home/ger/uni/reactor:/home/ger/uni/server:/home/ger/uni/htk:/home/ger/uni/davinci:/home/ger/uni/graphs:/home/ger/uni/tools:/home/ger/uni/cvs:/home/ger/uni/types -fglasgow-exts -fallow-overlapping-instances -fallow-undecidable-instances -cpp -ddump-hi-diffs -H25M -recomp -fwarn-deprecations -Onot -DDEBUG -Onot -H30M -fasm What is going on? I can send the complete .hi files for this project, but I'm not doing so here as it would bust haskell.org's 40k limit so delaying this extremely irritating bug from being reported and hopefully fixed. Is there a workaround? SimpleForm.hs Description: Binary data SimpleForm.hi Description: Binary data
ANNOUNCE: linkchk-0.01 released
Two months after the first release, linkchk version 0.01 is released! New in this version: * displays ping time instead of ok status * IPv6 support * command option to set delay between pings * uses netstat instead of /proc/net/route * uses popenhs * uses automake and autoconf The source and rpm files are available from: http://www.01.246.ne.jp/~juhp/haskell/linkchk/ Feedback, comments and code contributions appreciated, Jens ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: qforeign-0.65: Bzip2: problems with [Word8]
On Tue, 16 Oct 2001, Ashley Yakeley wrote: At 2001-10-16 11:12, Michael Marte wrote: But I need String - String! (Reading from a file, decompressing, and feeding it to the XML parser.) How can I do this? The reading from a file part is arguably a misdesign in the standard libraries. There ought to be Word8-based file IO functions for reading/writing the bytes of a file. I'm not sure, but I think the Char-based functions may even do newline conversion. readFile :: FilePath - IO String works fine for me, also when reading binary files. But yes, maybe there should be a function returning IO Word8. Obviously, the implementation of readFile automatically converts from Word8 to Char and it is not only a type cast because Char has 16 bits. I found out that fromIntegral does the conversion from Word8 to Char but I do not know how to convert from Char to Word8. I think fromIntegral will work for that too. No, there is no suitable instance. However, it works like this: map (toEnum . fromEnum) . Bzip2.decompress . map (toEnum . fromEnum) Michael ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: IO concurrency
I didn't try ghc-5.02 since I haven't installed it yet. Could you do that? The IO library in 5.00.2 had a bug in fdToHandle which meant that it didn't put the file descriptor into non-blocking mode, and I suspect this is the cause of your problem. It works. Thank you. Max. ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Does GHS has FFI for Mac OS X?
Hi, Can someone tell me if GHC has a working FFI on Mac OS X? And also if someone has succeeded in installing GHC on Mac OS X? Thanks, --shiv-- ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
ANNOUNCE: linkchk-0.01 released
Two months after the first release, linkchk version 0.01 is released! New in this version: * displays ping time instead of ok status * IPv6 support * command option to set delay between pings * uses netstat instead of /proc/net/route * uses popenhs * uses automake and autoconf The source and rpm files are available from: http://www.01.246.ne.jp/~juhp/haskell/linkchk/ Feedback, comments and code contributions appreciated, Jens ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
Re: proofs
Rijk-Jan van Haaften writes: I used 3 main properties for the process: ... 2. Lifting local let definitions to a higher level let f = let g = gExpr in fExpr in expr can be translated into let g = gExpr f = fExpr in expr The definition of g which is local for f in the first expression is made more global in the second one. Care has to be taken if g (which might be bound outside this let-block) occurs in expr, because with the translated version it is now bound to gExpr. Renaming helps (for some unused g'): let g' = gExpr f = fExpr[g - g'] in expr -- Janis Voigtlaender http://wwwtcs.inf.tu-dresden.de/~voigt/ mailto:[EMAIL PROTECTED] ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
proofs
I want to learn how to go about proving things like (p = j) = k == p = (\x-(j x = k)) where p = k = \s0 - let (s1, a) = p s0 in k a s1 eg, verifying that the 3 monad laws hold for a specific monad. also, verifying the more numerous laws every arrow should obey. I could teach myself to do it clumsily, but I want to learn from others. would learning category theory help me do this? pointers to documents? proof-assistant software? ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
Examples of some nice Haskell programs
There are some nice examples (binaries) of [Haskell + HOpenGL] programs at: www.cin.ufpe.br/~haskell/hopengl/examples.html I think they may be of interest to the community because they confirm that it's really possible to use Haskell in the development of complex, fast and robust graphic applications and games that involve animation and other interesting issues (texturing, lighting, checking and analyzing multiple user inputs, etc.) -- Andre ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
Re: proofs
I will attempt to explain how I would work out the problem. If my description is incomplete or wrong sure some more experienced reader will tell us. I want to learn how to go about proving things like (p = j) = k == p = (\x-(j x = k)) where p = k = \s0 - let (s1, a) = p s0 in k a s1 First, I give the results of my (3-minute) analysis: Substitution of the given definition leads for the left-hand side to (\s0 - let { (s1, a) = p s0 (s2, b) = j a s1 } in k b s2 ) The right-hand side is (\s0 - let { (s1, a) = p s0 (s2, b) = j a s1 } in k b s2 ) These are clearly the same I used 3 main properties for the process: 1. Renaming of variables for example: (\x - x + y) == (\z - z + y) Changing x to z is legal here. However, we can not rename x to y because y is already used. So be carefull with renaming actions. 2. Lifting local let definitions to a higher level let f = let g = gExpr in fExpr in expr can be translated into let g = gExpr f = fExpr in expr The definition of g which is local for f in the first expression is made more global in the second one. The translation back is not always possible (impossible if g and f are mutual recursive, that is: use each other) 3. Lambda elimination (\x - x + 3) y == y + 3 --- Complete example (left-hand side) --- I want to learn how to go about proving things like (p = j) = k == p = (\x-(j x = k)) where p = k = \s0 - let (s1, a) = p s0 in k a s1 (p == j) equals (\s0 - let (s1, a) = p s0 in j a s1) rename s0, s1 and a to s2, s3 and b resp. (\s2 - let (s3, b) = p s2 in j b s3) This avoids name-conflicts later on. Say this last expression is called f (just to make reading easier), so f == (\s2 - let (s3, b) = p s2 in j b s3) f = k equals (\s0 - let (s1, a) = f s0 in k a s1) Now substitute de definition for f (\s0 - let (s1, a) = (\s2 - let (s3, b) = p s2 in j b s3) s0 in k a s1 ) Lambda elimination is the next step. ((\s2 - ...) s0) is candidate for this step. The result is (\s0 - let (s1, a) = let (s3, b) = p s0 in j b s3 in k a s1 ) This was the step which eliminated s2, so we can rename s3 to s2 now, just to remove the gap between s1 and s3: (\s0 - let (s1, a) = let (s2, b) = p s0 in j b s2 in k a s1 ) At this point, lifting a local definition to a higher level comes in view: let (s1, a) = let (s2, b) = p s0 in j b s2 in ... is the same as let (s2, b) = p s0 (s1, a) = j b s2 in ... This yields (\s0 - let (s2, b) = p s0 (s1, a) = j b s2 in k a s1 ) Which is the result above, except that the names of s1 and s2 are swapped. This makes no real difference though and a renaming action is enough to fix it. Now, try to write out the right-hand side yourself. These three transformations are enough for now. There are lots of such equality (or half- equality) transformations, but I don't know concrete resources. Others on the mailing list can probably point out some good resources. Rijk-Jan ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
please add me
[EMAIL PROTECTED]
Newbie question about classes and class parameters
Let's say we have infamous Set class defined this way: class Set s a where empty :: s a isEmpty :: s a - Bool Lets also say that we could define sets as lists: data SetAsList a = SL [a] deriving (Eq,Ord,Show) instance Set SetAsList a where empty = SL [] isEmpty (SL []) = True isEmpty _ = False So far, so good. Lets define type synonim for set of integers: type IntegerSet = SetAsList Integer And set of sets of integers: data IntegerSuperSet = ISS (SetAsList IntegerSet) Testing in Hugs show that everything seems to be working: Main :t ISS (SL [ (SL [1,2,3])::IntegerSet, (SL [4,5,6])::IntegerSet ]) ISS (SL [SL [1,2,3],SL [4,5,6]]) :: IntegerSuperSet However: Main isEmpty (ISS (SL [(SL [1,2,3])::IntegerSet, (SL [4,5,6])::IntegerSet])) ERROR - Type error in application *** Expression : isEmpty (ISS (SL [SL [1,2,3],SL [4,5,6]])) *** Term : ISS (SL [SL [1,2,3],SL [4,5,6]]) *** Type : IntegerSuperSet *** Does not match : a b This is completely understood - I need to state that IntegerSuperSet is an instance of Set for isEmpty to be working. But: instance Set IntegerSuperSet where empty = ISS (SL []) isEmpty (ISS (SL [])) = True isEmpty _ = False gives me: Reading file /tmp/bug.lhs: ERROR /tmp/bug.lhs:38 - Wrong number of arguments for class Set Obviously I am missing something very important here. Could someone enlighten me? -- Dmitry Astapov //ADEpt E-mail: [EMAIL PROTECTED] Information Systems Expert Office: +380-50-110-3876 Ukrainian Mobile Communications Mobile: +380-50-330-2019 GPG KeyID/fprint: F5D7639D/CA36 E6C4 815D 434D 0498 2B08 7867 4860 F5D7 639D ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Newbie question about classes and class parameters
Dmitry Astapov wrote (on 17-10-01 11:25 +0300): Let's say we have infamous Set class defined this way: class Set s a where empty :: s a isEmpty :: s a - Bool [..] instance Set IntegerSuperSet where empty = ISS (SL []) isEmpty (ISS (SL [])) = True isEmpty _ = False gives me: Reading file /tmp/bug.lhs: ERROR /tmp/bug.lhs:38 - Wrong number of arguments for class Set Obviously I am missing something very important here. Could someone enlighten me? First, the class declaration defines Set as having two parameters, s and a. In an instance declaration, you must supply types for both. So: instance Set IntegerSuperSet Integer where ... would be correct, except for the second problem, which is that in Set s a, s is actually type constructor (of kind * - *), while the argument which you try to supply for s, namely IntegerSuperSet, is a type constant (of kind *). So there is a kind mismatch. Try this instead: data SuperSet a = SuperSet (SetAsList a) instance Set SuperSet a where ... -- Frank Atanassow, Information Computing Sciences, Utrecht University Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands Tel +31 (030) 253-3261 Fax +31 (030) 251-379 ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe
(no subject)
subscribe
please add me
[EMAIL PROTECTED]