Hello again,
Sorry for asking again but I can't find the
answer in the on line user manual.
What does one have to do to use mutable arrays?
An old program won't compile anymore with a very
recent ghc from CVS. I am using GlaExts.
Thanks in advance.
Regards,
Marc van Dongen
--
Marc van
On Tue, May 09, 2000 at 11:37:46 +0100, Marc van Dongen wrote:
What does one have to do to use mutable arrays?
An old program won't compile anymore with a very
recent ghc from CVS. I am using GlaExts.
$ cvs log ghc/lib/std/PrelArr.lhs
revision 1.19
date: 2000/03/14 12:16:00; author:
Michael Weber ([EMAIL PROTECTED]) wrote:
[...]
: $ cvs log ghc/lib/std/PrelArr.lhs
:
: revision 1.19
: date: 2000/03/14 12:16:00; author: simonmar; state: Exp; lines: +57 -57
: Simplfy the mutable array story:
: - rename MutableArray to STArray (and similarly
: for all
tryAll (runST (return (error "BANG!")))
will return (Right (error "BANG!")), because return isn't strict.
Nope,
main = tryAll (runST (return (error "BANG!"::( = print
yields `Left "BANG!"'!
but
main = tryAll (runST (
return ((error "BANG!",
Do you derive Show for MyData?
-Original Message-
From: Mike Jones [mailto:[EMAIL PROTECTED]]
Sent: 09 May 2000 05:58
To: [EMAIL PROTECTED]
Subject: Showing tuples
Hi,
I am having trouble with Show and tuples.
I have a data structure, say:
data MyData = ...
And a
On Tue, 2 May 2000, Keith Wansbrough wrote:
Off-topic, I know, but even if this worked as I think you intend,
it would hardly be random and would certainly be unsuitable for use as a
nonce. Applying `mkStdGen' to the current time doesn't make it any more
random! You might as well use
Jan Skibinski writes:
Good point. Short of reading some truly random device
(perhaps ambient temperature fluctuation) this can be always
theoretically defeated. I can only make life more difficult
to the attacker by trying to outsmart him algoritmically
(Or to
Jan Skibinski [EMAIL PROTECTED] writes:
Any good idea? First prize: a bottle of something good. :-)
The easiest ought to simply have enough granularity in the
gettimeofday() or equivalent. Sure you can guess the approximate time
in hours or seconds, but can you guess it in micro- or
On Tue, 9 May 2000, Frank Atanassow wrote:
Jan Skibinski writes:
Any good idea? First prize: a bottle of something good. :-)
There is a thing known as an Entropy Gathering Demon (EGD).
From http://www.lothar.com/tech/crypto/ :
You have been nominated for the first prize,
Chris,
Yes, I do derive Show for MyData. I was surprised it did not work.
Mike
-Original Message-
From: Chris Angus [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 09, 2000 12:57 AM
To: 'Mike Jones'; [EMAIL PROTECTED]
Subject: RE: Showing tuples
Do you derive Show for MyData?
Mike Jones wrote:
Yes, I do derive Show for MyData. I was surprised it did not work.
Deriving works, but GHC currently only contains instance declarations
for tuples up to 5 elements, so you have to write you own boring
instances for larger ones. *yawn*
Cheers,
Sven
--
Sven Panne
Mike ... try this ...extend it to however long tuples you have
data MyData = Foo | Bar deriving Show
main = print (Foo,Foo,Foo,Foo,Foo,Foo)
instance (Show tv1, Show tv2, Show tv3, Show tv4, Show tv5 , Show tv6) =
Show (tv1,tv2,tv3,tv4,
tv5,tv6) where
showsPrec p (v1,v2,v3,v4,v5,v6) =
Hi,
I am having trouble with Show and tuples.
I have a data structure, say:
data MyData = ...
And a value, say:
value = (MyData..., MyData..., MyData)
Then try to:
show value
I get a compiler message from ghc 4.05 that says:
No instance for `Show (MyData, MyData, MyData)...
What is
Do you derive Show for MyData?
-Original Message-
From: Mike Jones [mailto:[EMAIL PROTECTED]]
Sent: 09 May 2000 05:58
To: [EMAIL PROTECTED]
Subject: Showing tuples
Hi,
I am having trouble with Show and tuples.
I have a data structure, say:
data MyData = ...
And a
Sven,
That explains it. My tuples are of size 20.
Thanks,
Mike
Deriving works, but GHC currently only contains instance declarations
for tuples up to 5 elements, so you have to write you own boring
instances for larger ones. *yawn*
Cheers,
Sven
--
Sven Panne
Mon, 8 May 2000 20:42:10 -0700 (PDT), Ronald J. Legere [EMAIL PROTECTED] pisze:
I have a very simple question. What is the best way to
convert a float to a double?
I use fromRational.toRational, and the notes in the prelude
seem to imply that this is optimized into something sensible..
Jan Skibinski wrote:
Any good idea? First prize: a bottle of something good. :-)
In C, I've sometimes added in the memory location of an arbitrary
variable, just for good measure. But that's not quite as secure in an
open source environment. (Maybe not even that secure in a closed
Michael Hobbs wrote:
I believe that the P3 chips come with a noisy diode built-in,
specifically for the purpose of generating random numbers. You might try
to find a way to access that little gizmo. (Assuming that you're running
on a P3.)
Interesting! Do you have any reference for this?
I
18 matches
Mail list logo