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),
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
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.
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
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
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).
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
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
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