
17 Jun
2011
17 Jun
'11
8:11 a.m.
On Jun 17, 2011, at 7:00 AM, Kees Bleijenberg wrote:
How can I express the fact that all sudoku solvers use the same recordtype? Can I make a type of the record structure {board:: Board.... } and use it in the constructor function or can I incorperate the recordtype in the class or ......?
This is a good use for the "newtype" declaration. Define your SudokuRecord and then specialize it using newtype. data SudokoRecord ... newtype SudokuTwins = SudokuTwins SudokuRecord newtype Sudoku9x9 = Sudoku9x9 SudokuRecord instance SudokuClass SudokuTwins where ... instance SudokuClass Sudoku9x9 where ... ____________________ David Place Owner, Panpipes Ho! LLC http://panpipesho.com d@vidplace.com