
15 Apr
2008
15 Apr
'08
12:45 a.m.
On Tue, Apr 15, 2008 at 3:45 AM, Benjamin L. Russell
hanoi_shower ((a, b) : moves) | null moves = "Move " ++ show a ++ " to "++ show b ++ "." | otherwise == "Move " ++ show a ++ " to "++ show b ++ "." ++ hanoi_shower moves
More idiomatic pedantry: the way you will see most Haskellers write this style of function is by pattern matching rather than guards: hanoi_shower [] = "" hanoi_shower ((a,b):moves) = "Move " ++ show a ++ " to " ++ show b ++ ".\n" ++ hanoi_shower moves Luke