Re: [Haskell-cafe] Type classes... popular for newbies, isn't it?

2004-08-09 Thread Stefan Holdermans
Arjun, AG This class definition is giving me a lot of problems AG with the successor function: class (Ord st) = MinimaxState st where successors :: st - [(action, st)] terminal :: st - Bool instance MinimaxState Int where terminal i = i == 0 successors i = [(1,i+1),

Re: [Haskell-cafe] Type classes... popular for newbies, isn't it?

2004-08-09 Thread Stefan Holdermans
Arjan, AG I'm curious as to why my class declaration AG compiles in GHC, as there doesn't seem to AG be any way to use it. class (Ord st) = MinimaxState st where successors :: forall a . st - [(a, st)] terminal :: st - True Any implementation of the successors method needs to produce

RE: [Haskell-cafe] closed classes [was: Re: exceptions vs. Either]

2004-08-09 Thread C T McBride
Hi On Mon, 9 Aug 2004, Simon Peyton-Jones wrote: Closed classes are certainly interesting, but a better way to go in this case is to allow the programmer to declear new kinds, as well as new types. This is what Tim Sheard's language Omega lets you do, and I'm considering adding it to GHC.

Re: [Haskell-cafe] closed classes

2004-08-09 Thread Peter G. Hancock
At the moment I'm only thinking of parameter-less kind declarations but one could easily imagine kind parameters, and soon we'll have kind polymorphism but one step at a time. Any thoughts? Apologies if it's widely known, but a system with kind polymorphism was first considered by

RE: [Haskell-cafe] closed classes [was: Re: exceptions vs. Either]

2004-08-09 Thread MR K P SCHUPKE
kind statements sound like a good idea - a couple of questions spring to mind - what is the parameter of a kind statement (a type or a kind... a kind makes more sense) ... do we have to stop with kinds what about kinds of kinds - the statement has identical syntax to a data declaration, is there

[Haskell-cafe] Constructing a 'State Cover' for a FSM

2004-08-09 Thread Stu White
Hi all I'm trying to construct a cover for a finite state machine and needto devisea strategy beforehand. Thing is I'm having a little trouble. Could anyone suggest a generic strategy that can be used for constructing a cover (things like how I would identify the machines alphabet and so on).

RE: [Haskell-cafe] closed classes [was: Re: exceptions vs. Either]

2004-08-09 Thread MR K P SCHUPKE
Is there any possibility of a theory that will avoid the need to replicate features at higher and higher levels? If we consider types, types are a collection of values, for example we could consider Int to be: data Int = One | Two | Three | Four ... Okay, so the values in an integer are

Re: [Haskell-cafe] Combination-lock problem

2004-08-09 Thread Thomas L. Bevan
Just make the function recursive. There is a simple relation between, l [a,b,c] and l [b,c] Tom On Tue, 10 Aug 2004 14:01, Florian Boehl wrote: Hi, I'ld like to generate a list (of lists) that contains all combinations of natural numbers stored in another list. It should work like a

RE: [Haskell-cafe] closed classes [was: Re: exceptions vs. Either]

2004-08-09 Thread oleg
Simon Peyton-Jones wrote: kind HNat = HZero | HSucc HNat class HNatC (a::HNat) instance HNatC HZero instance HNatC n = HNatC (HSucc n) There is no way to construct a value of type HZero, or (HSucc HZero); these are simply phantom types. ... A merit of