Re: Constant space infinite itteration ... solution?

2002-12-13 Thread Jan Kort
[EMAIL PROTECTED] wrote: Also ... I've been using the graphics libs with HUGS, but I can't find the equivalent in GHC ... what is the recomended library for writing GUIs in GHC Haskell? And where do I get it? My current favourite way to make GUI's is to use the GUI painter Glade and have

Re: Floats and Doubles

2002-11-13 Thread Jan Kort
Juan Ignacio Garcia Garcia wrote: *P2 (fromRational ((toRational 4) - ( toRational 5.2 ))) -1.2002 I can't explain this one, how would fromRational know that it has to create a Double ? Jan ___ Glasgow-haskell-users mailing list [EMAIL

Re: Using the Parsec library

2002-09-10 Thread Jan Kort
Jose Romildo Malaquias wrote: Any sugestion on how to implement the 'not starting with A: or B:' problem? Hi, I'm not familiar with Parsec, but in ParseLib it's fairly straightforward, first you add a new combinator: ifnot :: Parser a - Parser b - Parser b ifnot (P p1) (P p2) = P ( \s -

Re: Beginner's question: Memo functions in Haskell

2002-06-05 Thread Jan Kort
Janis Voigtlaender wrote: It would also seem that one needs to write fast = memo slow instead, because otherwise a new memo-version of slow might be created for every call with some n (subject to let-floating?). However, the version: module Fib where import Memo slow 0

Re: sharing datatypes : best practice ?

2001-05-11 Thread Jan Kort
Taesch, Luc wrote: do u isolate just the datatype, or a few related with, in a very small file (header like, i would say) or some basic accessor function with it ? isnt it leading to massiv quantities of small files ? Asuming you have some typed AST with many mutually recursive

Re: failed when trying to compile FranTk with ghc

2001-04-09 Thread Jan Kort
luc wrote: I tried FranTk with ghc 4.08 and got : (this is the "fixed" FrankTk, alledged working with 4.06, if im not wrong) are there any difference with 4.06 and 4.08 ? Below is a list of fixes to get FranTk working with ghc4.08. Jan Run configure like normal, i.e.: ./configure

Re: Bagley shootout. Was: Lightningspeed haskell

2001-03-06 Thread Jan Kort
I implemented the programs for hash1 and hash2, but I had to make a lot of changes to FiniteMap to get them to work: - I changed foldl to foldl' (as defined in Hugs). - I made foldFM strict (like foldl'). - I made the datatype FiniteMap strict (put !'s everywhere). I put the programs below,

Re: Bagley shootout. Was: Lightningspeed haskell

2001-03-02 Thread Jan Kort
Simon Peyton-Jones wrote: A String is a [Char] and a Char is a heap object. So a file represented as a string takes a massive 20 bytes/char (12 for the cons cell, 8 for the Char cell). Then it's all sucked through several functions. It's entirely possible, though, that the biggest

Re: framework for composing monads?

2001-02-15 Thread Jan Kort
Andy Gill's Monad Template Library is good for that, but the link from the Haskell library page is broken: http://www.cse.ogi.edu/~andy/monads/doc.htm Jan ___ Haskell-Cafe mailing list [EMAIL PROTECTED]

Re: Floating point performance

2001-01-29 Thread Jan Kort
"Julian Seward (Intl Vendor)" wrote: I tried this, with ghc-4.08.1 -O both with and without profiling, on a Sparc box of I believe around 300 MHz, and I can't reproduce it at all. Without profiling, it allocates about 505 k of heap and runs in 0.02 seconds. Ummm ? J I didn't use

Floating point performance

2001-01-26 Thread Jan Kort
Hi, I noticed ghc (version 4.08.1) floating point performance is really slow on my computer: a 270Mhz sun ultra5. The program below does 1 milion floating point multiplications and takes 2 seconds to run. I made a profile and it says most of the time (93%) is spent in the function bar. Any idea

Re: C stack

2000-12-15 Thread Jan Kort
Simon Marlow wrote: I don't forsee any problems with the C stack - the stack pointer stays static during execution of Haskell code, and only moves when we do a C call or return to the RTS. But how do I get the address of the bottom of the stack ? It seems I can define a C main so I can get

C stack

2000-12-14 Thread Jan Kort
Hi, I'm trying to write an interface for a C library that uses a Boehm type garbage collector. So, I need to get the address of the bottom of the C stack. In a C application this would look something like: main() { int bottomOfStack; } Where "bottomOfStack" would be the thing I need.

Re: openFile, process file table full

2000-09-12 Thread Jan Kort
Simon Marlow wrote: Arguably, readFile is too strict: why is the file opened, if there aren't any characters needed. What is the motivation for opening the file eagerly? Once we've started reading lazilly, it's hard to generate errors. The file is opened eagerly so that any errors

openFile, process file table full

2000-09-08 Thread Jan Kort
Hi, The following program: module Main(main) where main:: IO() main = do { xs - mapM readFile (take 1000 (repeat "tmp")); return (); } Results in the error: Fail: resource exhausted Action: openFile Reason: process file table full tmp This doesn't work either: myreadFile

compiled program loops

2000-04-08 Thread Jan Kort
I compiled a program using ghc version 4.06 and it goes into a loop, I tried figuring out what goes on with "trace", but it looks as if this is a ghc bug. Wether it loops or not depends on the length of the list: if you remove 1 "Int 1" line in the code below it will finish immediatly. I need a

Re: records in Haskell

2000-03-16 Thread Jan Kort
Simon Marlow wrote: Jan Kort writes: It seem that any record, no matter how trivial, can't be much longer than about 200 lines in Haskell. If a try to compile a 300 line record containing just: data X = X { f1 :: String, f2 :: String, f3 :: String

deriving Read and Show

2000-02-22 Thread Jan Kort
Hi, When I use deriving Read and Show on many datatypes, both ghc and hugs don't work. I've attached an example, to get the error, do: hugs Main.hs or: ghc Main.hs Hugs quits with the error message: ERROR "Main.hs": Type constructor storage space exhausted And ghc quits with:

records in Haskell

2000-02-11 Thread Jan Kort
Hi, It seem that any record, no matter how trivial, can't be much longer than about 200 lines in Haskell. If a try to compile a 300 line record containing just: data X = X { f1 :: String, f2 :: String, f3 :: String, ... f300 :: String } It needs about 90M

FFI bug ?

2000-01-31 Thread Jan Kort
Hi, It seems that FFI no longer accepts "ByteArray Int" in ghc 4.06 (it does in ghc 4.04), it looks intentional ? If so, is there another way to pass a String to a C function ? If not, I have attached a small example, to see the result do: tar -xf abc.tar make The result should be:

Re: drop take [was: fixing typos in Haskell-98]

2000-01-28 Thread Jan Kort
Marcin 'Qrczak' Kowalczyk wrote: My preference is still (B). (A) is not *very* bad, but should really replicate (-7) "foo" be []? Mine too. Actually after writing my own version of "drop" it turns out that in my case n 0 is a programmer error and n length xs a user error. So what you end up

FFI on sparc

2000-01-24 Thread Jan Kort
Hi, I'm using the FFI on a sparc. Everything works fine except when I return a float or double from C to Haskell. My config is: SunOS 5.6 cpu0: SUNW,UltraSPARC-IIi (upaid 0 impl 0x12 ver 0x12 clock 270 MHz) SUNW,m64B0 is /pci@1f,0/pci@1,1/SUNW,m64B@2 stdout is /pci@1f,0/pci@1,1/SUNW,m64B@2

prelude drop and take

2000-01-18 Thread Jan Kort
Hi, This minor inconsistency has been bothering me for some time: Prelude drop 10 "test" "" Prelude drop (-1) "" "" Prelude drop (-1) "a" " Program error: Prelude.drop: negative argument I got these results from Hugs, but the code is identical to that specified in the Haskell98 standard. Why

Re: bootstrapping ghc on AIX

1998-10-20 Thread Jan Kort
Sigbjorn Finne (Intl Vendor) wrote: Jan Kort [EMAIL PROTECTED] writes: Thanks, I can get a lot further now, everything apart from compiling the assembler files and linking the hsc works, but that will have to wait till tommorow :) Jan Great, if you should get stuck while

Re: bootstrapping ghc on AIX

1998-10-16 Thread Jan Kort
"$(GhcWithHscBuiltViaC)" "NO" 24 SUBDIRS = utils driver includes rts docs compiler lib 25 else 26 SUBDIRS = utils driver includes rts docs lib compiler 27 endif Shouldn't this be 'ifeq "$(GhcWithHscBuiltViaC)" "YES"' ? Jan -- Jan Kort

bootstrapping ghc on AIX

1998-10-16 Thread Jan Kort
Error 1 make[1]: *** [all] Error 1 make: *** [all] Error 1 Which I don't understand, am I missing some hc files ? Regards, Jan -- Jan Kort