Re: [Haskell] help with some basic code that doesn't work

2005-02-08 Thread Matthew Walton
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,

Re: [Haskell] help with some basic code that doesn't work

2005-02-08 Thread Malcolm Wallace
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.

Re: [Haskell] help with some basic code that doesn't work

2005-02-08 Thread Karl Hasselström
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

[Haskell] help with some basic code that doesn't work

2005-02-07 Thread pablo daniel rey
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),      

[Haskell-cafe] Re: [Haskell] help with some basic code that doesn't work

2005-02-07 Thread Cale Gibbard
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 =