pablo daniel rey wrote:
hello
i'm new to haskell so i'm sorry if this is a stupid question, but i'm having
problems with some basic code.
the code :
data Maybe Dir = Just Dir | Nothing
data Dir = Left | Right | Up | Down
data Piece = Vertical | Horizontal | CodeA | CodeB
flow = [(Horizontal,
Matthew Walton [EMAIL PROTECTED] writes:
(==) works on types which are members of the Eq typeclass. You can
define this instance manually, or, since your type is nice and simple,
^^
you can get Haskell to derive it for you.
On 2005-02-07 20:36:55 +, pablo daniel rey wrote:
data Dir = Left | Right | Up | Down
data Piece = Vertical | Horizontal | CodeA | CodeB
the error i get :
Instances of (Eq Dir, Eq Piece) required for definition of chgDir
You try to compare Dir and Piece values without having told
hello
i'm new to haskell so i'm sorry if this is a stupid question, but i'm having
problems with some basic code.
the code :
data Maybe Dir = Just Dir | Nothing
data Dir = Left | Right | Up | Down
data Piece = Vertical | Horizontal | CodeA | CodeB
flow = [(Horizontal, Left, Left),
Delete
data Maybe Dir = Just Dir | Nothing
as it is unnecessary Maybe a is defined already for any type a
(and doesn't make sense, Dir occuring before the = sign would indicate
that it is a type variable, but it is uppercase), and also change
data Dir = Left | Right | Up | Down
data Piece =