[Haskell] How to close a type class

2004-11-11 Thread oleg
It is well known that type classes in Haskell are open. A user may at any time extend a visible type class by providing a new instance. There are situations where such an extensibility is undesirable. We may want to prevent the user from adding an instance to our class for some specific type -- or

Re: [Haskell] Re: About Random Integer without IO

2004-11-11 Thread Clive Brettingham-Moore
This really really should have moved to haskell-cafe as previously suggested (sending to both with this in mind); apologies for being a little confising to haskell-cafe This isn't a language design issue, it is a FAQ, or at best a nebulous conceptual debate (speaking of which, has anyone got somet

[Haskell] Re: About Random Integer without IO

2004-11-11 Thread karczma
Thomas Davie writes, commenting my statement that one does need any 'stateful' (monadic, etc.) RN generator initializer within the program, since you can always pass a parameter during its launching. While I agree that it is often useful to start your program with different parameters each time

[Haskell] Re: About Random Integer without IO

2004-11-11 Thread Thomas Davie
On 11 Nov 2004, at 22:02, karczma wrote: Thomas Davie writes: This method unfortunately depends on having a seed first though. Which "this method"? Please, quote the text you are referring to *before* your answer. One must use a different value every time the program is started, commonly time or

[Haskell] Re: About Random Integer without IO

2004-11-11 Thread karczma
Thomas Davie writes: This method unfortunately depends on having a seed first though. Which "this method"? Please, quote the text you are referring to *before* your answer. One must use a different value every time the program is started, commonly time or the first few bytes from /dev/rando

Re: [Haskell] Re: About Random Integer without IO

2004-11-11 Thread Thomas Davie
This method unfortunately depends on having a seed first though. One must use a different value every time the program is started, commonly time or the first few bytes from /dev/random. Any one of these is going to require a monadic function to generate (i.e. it must come from the environment

[Haskell] Re: About Random Integer without IO

2004-11-11 Thread karczma
Georg Martius answers the request of: Jose Manuel Hernando CobeÃa I need generate random numbers by create polygons with "wxHaskell", I am searching in the web, but all I only find IO functions like test :: Integer -> IO Integer ... I need this but with types :: Integer -> Integer you need to rea

Parameterized Show? was Re: [Haskell] Conceptual overloading of show?

2004-11-11 Thread Shae Matijs Erisson
Graham Klyne <[EMAIL PROTECTED]> writes: > I raise a topic that has occurred to me repeatedly during my time with > Haskell. I am prompted to do so by a discussion in another place, where a > significant (and, apparently, recurring) concern about the use and abuse of > Java's toString() function

Re: [Haskell] About Random Integer without IO

2004-11-11 Thread Georg Martius
Hi, you need to reallise that Haskell is a pure language. That means a function has the same result if you call it with the same arguments (deterministic). A function that produces random numbers are not of such kind in the first place. However, what you need to do is to pass the random number ge

[Haskell] About Random Integer without IO

2004-11-11 Thread Jose manuel Hernando Cobeña
I need generate random numbers by create polygons with "wxHaskell",I am searching in the web, but all I only find IO functions like>>    test   :: Integer -> IO Integer>>    test n =  do x <- randomRIO (1, n)  return xI need this but with types :: Integer -> Integer ThanksEscapa

[Haskell] Conceptual overloading of show?

2004-11-11 Thread Graham Klyne
I raise a topic that has occurred to me repeatedly during my time with Haskell. I am prompted to do so by a discussion in another place, where a significant (and, apparently, recurring) concern about the use and abuse of Java's toString() function is being raised. It seems to me that there are