Problem when compiling with -prof -fasm

2003-06-12 Thread Zdenek Dvorak
/projects/ghc/. (without -fasm I get Prologue junk?: .globl __stginit_CGI .type __stginit_CGI,@function __stginit_CGI: pushl %ebp movl%esp, %ebp instead, which is probably caused by non-supported version of gas or gcc?) Zdenek Dvorak

Re: int to float problem

2003-03-01 Thread Zdenek Dvorak
Hello, [snip] Try intToFloat :: Int - Float intToFloat n = fromInteger (toInteger n) [snip] Use the Prelude function realToFrac. it sometimes happens to me that I must spend some time browsing prelude to devise somethink like this; it might be useful to have a library for this, that would

Re: FiniteMap performance WITHOUT any copying?

2003-02-08 Thread Zdenek Dvorak
Hello, Now, Haskell has a garbage collector, so Haskell must know how many pointers there are to all objects in the heap (or?). Then, if a finite map for example only has one single pointer to it, then it ought to be all right to modify the finite map (or whatever datastructure we are

Re: default class methods in sub-classes

2003-02-06 Thread Zdenek Dvorak
Hello, Apparently I can't do this (in ghc or hugs -- haven't tried others): class Space a where distance :: a - a - Int subtract :: a - a - a class (Space a) = NormSpace a where norm :: a - Int distance a b = norm (subtract a b) That is, I can't make (or redefine) a default for the

Re: avoiding cost of (++)

2003-01-16 Thread Zdenek Dvorak
) Zdenek Dvorak _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org

Re: Question About Random Module

2002-12-24 Thread Zdenek Dvorak
Hello, Hello! I just Wanna Know, What should I do, to build a List of random Numbers, without IO type, just Float or Int the answer for this is either you can't, read something about IO and monads (good starting places are http://haskell.org/wiki/wiki?UsingIo and

Re: Running out of memory in a simple monad

2002-11-29 Thread Zdenek Dvorak
of first list, so it is constant in our case; summing it over all putCharMs, we get linear time and we are happy :-) If you want to do it the first way, define putCharM c = M $ \o - ((), c : o) and then reverse the list in runM. Zdenek Dvorak

Re: need help optimizing a function

2002-10-08 Thread Zdenek Dvorak
are doing the work monads would do for you. So in general you must choose -- either your programs will be nice and functional, but you will have to use structures with (some kind of) logarithmic slowdown (FiniteMap, Trie), or some of their parts will be embedded in monads. Zdenek Dvorak

Re: how to debug?

2002-10-06 Thread Zdenek Dvorak
it with profiling (-prof -auto-all) and running with +RTS -xc will give you a stack dump (pretty useful, well hidden feature :-) Zdenek Dvorak _ Chat with friends online, try MSN Messenger: http://messenger.msn.com

Re: Pretty printing (was: Standard Library for text formatting?)

2002-08-26 Thread Zdenek Dvorak
them to work like that). I have written following module that implements stupid first-fit algorithm for these purposes; the interface is simmilar to the pretty printing libraries. Zdenek Dvorak module ReportPrinter ( LowDoc,HighDoc, (),(+),($$),($), int, lowText, text, empty, colon, comma, space

RE: comparison of execution speed of array types

2002-07-23 Thread Zdenek Dvorak
was forced to write my own version (it is a bit faster, but still nothing great). My suspicion about the result of your measuring is that it does the updates in reversing the array one by one, thus leading to quadratic behavior. Zdenek Dvorak

Defining instances of superclasses

2002-06-30 Thread Zdenek Dvorak
want to use it; also I may no longer use deriving Show on types containing such structure. Is there some better way how to do this? Zdenek Dvorak _ Send and receive Hotmail on your mobile device: http://mobile.msn.com

Re: Haskell digest, Vol 1 #656 - 3 msgs

2002-06-29 Thread Zdenek Dvorak
) Especially, I would need class D above. class C can be rewritten to class C x y z | x - y, x - z concerning class D, I used (in GHC) class D x y z | x y - z and it seemed to do what I wanted. I guess class C x y z | x - y z would work too. Zdenek Dvorak

Re: Haskell puzzles!

2002-03-20 Thread Zdenek Dvorak
and e2 are obviously undefined. Zdenek Dvorak _ Chat with friends online, try MSN Messenger: http://messenger.msn.com ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org