Module GD

2000-03-24 Thread Jan Skibinski
I would not take your time here if it were not for the fact that my log file shows some traffic to GD module in the last few days -- while I was still making changes to it. Since I have finished with it for now I might as well announce it here. GD

Re: Random numbers

2000-03-24 Thread Koen Claessen
Michael Marte wrote: | I need to specify an endless stream of independent | random number generators. | | I wonder whether it is better to use split ... ... or | to increment the seed in the recursive call like: | [using `next'] I think the Random library needs some serious cleaning up fo

constructor for Ratio. Reply

2000-03-24 Thread S.D.Mechveliani
There were several letters on the subject of constructing Ratio values with n % m, n :% m (impossible). Haskell-98 provides the function (or operation) % that models the rule for the symbol `/' for Rational numbers in mathematics. Similar as ` 4/(-6) = 2/(-3) = (-2)/3 ' i

Random numbers

2000-03-24 Thread Michael Marte
Hello, I need to specify an endless stream of independent random number generators. I wonder whether it is better to use split (flawed or not, doesn't matter) like: stdGens2 :: [StdGen] stdGens2 = stdGens' (mkStdGen seed) where stdGens' gen = gen1 : stdGens' gen2 where (gen1, gen2)

Re: runtime optimization of haskell

2000-03-24 Thread Rob MacAulay
--- Forwarded Message Follows --- From: Rob MacAulay <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject:Re: runtime optimization of haskell Date sent: Fri, 24 Mar 2000 10:59:33 - Date sent: Thu, 23 Mar 200

Re: Ratio: (-1:%1) < (-1:%1)?

2000-03-24 Thread Marc van Dongen
Lennart Augustsson ([EMAIL PROTECTED]) wrote: : > The definition : > of (*) in the Prelude has to be clumsy because it cannot : > assume that this will the case because users can construct : > their own Ratios. : How can a user create his own Ratio? The % operation does the : GCD reduction, as d

Re: Ratio: (-1:%1) < (-1:%1)?

2000-03-24 Thread Lennart Augustsson
> The definition > of (*) in the Prelude has to be clumsy because it cannot > assume that this will the case because users can construct > their own Ratios. How can a user create his own Ratio? The % operation does the GCD reduction, as does every other operation that creates a Ratio. --

Re: Ratio: (-1:%1) < (-1:%1)?

2000-03-24 Thread Marc van Dongen
D. Tweed ([EMAIL PROTECTED]) wrote: : If you haven't loaded any modules then hugs is in `module scope' of : prelude and it's possible. If you do, eg, :l List then you end up in that : module scope and it's no longer allowed. That's exactly what happend. I ran hugs and typed in (1:?2). I was just

Re: Ratio: (-1:%1) < (-1:%1)?

2000-03-24 Thread D. Tweed
On Fri, 24 Mar 2000, Marc van Dongen wrote: > Hmm. I must have missed something. My hugs (1.4) allows it. > I was assuming that Haskell did allow it. > As it turns out my latest ghc doesn't. That's cool. If you haven't loaded any modules then hugs is in `module scope' of prelude and it's possibl

Re: Ratio: (-1:%1) < (-1:%1)?

2000-03-24 Thread Marc van Dongen
Lennart Augustsson ([EMAIL PROTECTED]) wrote: : > I am not quite sure how to express this in Haskell : > terms but here it goes anyway: Why is :% in Ratio : > not hidden? : What?!? Of course :% is hidden. It's always been hidden. : If it isn't it's a bug in your implementation or a (new) bug :

Re: Ratio: (-1:%1) < (-1:%1)?

2000-03-24 Thread Marc van Dongen
Jerzy Karczmarczuk ([EMAIL PROTECTED]) wrote: [...] : First of all: at least in Hugs (:%) is *not* exported by : the Prelude. : : So, it is hidden, and a sane, well educated gentleman would : not procreate a fraction with negative denominator. That is the point I am trying to make. Not all peop

Re: Ratio: (-1:%1) < (-1:%1)?

2000-03-24 Thread Lennart Augustsson
> I am not quite sure how to express this in Haskell > terms but here it goes anyway: Why is :% in Ratio > not hidden? What?!? Of course :% is hidden. It's always been hidden. If it isn't it's a bug in your implementation or a (new) bug in the repotr. It's always been hidden before; exposing i

Re: Ratio: (-1:%1) < (-1:%1)?

2000-03-24 Thread Jerzy Karczmarczuk
Marc van Dongen wrote: > I am not quite sure how to express this in Haskell > terms but here it goes anyway: Why is :% in Ratio > not hidden? > > By allowing a user program to construct elements of > the form (a:%b) one can create objects which lead to > inconsistencies ... > (-1:%1) < (0:%1

Ratio: (-1:%1) < (-1:%1)?

2000-03-24 Thread Marc van Dongen
Dear group, Maybe others have mentioned this as well but I can't recall having seen this anywhere. I am not quite sure how to express this in Haskell terms but here it goes anyway: Why is :% in Ratio not hidden? By allowing a user program to construct elements of the form (a:%b) one can creat