What does this error message mean

Richard Watson rwatson@usq.edu.au
Wed, 31 Oct 2001 10:11:54 +1000 (EST)


At 9:38pm on Oct 30, 2001, haskell-cafe-admin@haskell.org wrote:

> My (current) problem lies in whatPic, which returns the error
> Program error: {whatPic Facing2_North (1,6)}
> if I type in
> whatPic North (1,6)
> or just call it through the draw2 function (which is supposed to be the
> main drawing function, and it actually works.. Well it did yesterday until
> I did something :D

The problem is in whatPic.
Messages like
   Program error: {whatPic Facing2_North (1,6)}
say that there is no matching function RHS for the arguments
specified.

In your case the arguments did match the patterns specified in
whatPic, but neither of the two function guards was true.

Try this to check:

whatPic :: Facing2 -> (Int,Int) -> Pic
whatPic facin (x,y)     | corridorType facin (x,y) == (2, "rTurn1") = corrl_1
                        | corridorType facin (x,y) == (2, "rTurn2") = corrl_2
			| otherwise = error "whatPic: cases exhausted"



-- Richard