
"Daniel" == Daniel Fischer
writes:
Daniel> If e.g. Daniel> data Move = Move {from :: Position, to :: Position} Daniel> , the instance would be Daniel> instance NFData Move where rnf (Move f t) = rnf f `seq` Daniel> rnf t `seq` () Daniel> That might require NFData instances for Position and its Daniel> components, but specifying these should be automatic. <switched to beginners list> Move is somewhat more complicated than that, but it comes down to specifying instances for data Piece_colour = Black | White and data Piece_type = Lance | Reverse_chariot | Side_mover | Vertical_mover | White_horse | Rook ... many more which I'm not sure how to do. I tried added a deriving clause, but the compiler complains: Can't make a derived instance of `NFData Piece_colour' (`NFData' is not a derivable class) In the data type declaration for `Piece_colour' here I don't have and fields to force. -- Colin Adams Preston Lancashire