On Tue, Apr 15, 2008 at 3:45 AM, Benjamin L. Russell <[EMAIL PROTECTED]> wrote: > 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 _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
