On Thu, 15 Feb 2007 23:17:11 +0100, Gene A <[EMAIL PROTECTED]> wrote:

A couple of functions:
Prelude> let box a = a:[]
Prelude> let formatTableItems (a,b) = (box a) ++ " = " ++ (show b) ++ "\n"

This can be done simpler:
formatTableItems (a,b) = [a] ++ " = " ++ (show b) ++ "\n"

Yet simpler:
formatTableItems (a,b) = a : " = " ++ (show b) ++ "\n"

To improve further:
formatTableItems (a,b) = a : " = " ++ (show b) ++ "\n"
putStrLn $ foldr (++) "\n"$ map formatTableItems lowerCaseTable
can be replaced with:
formatTableItems (a,b) = a : " = " ++ (show b)
putStrLn $ unlines $ map formatTableItems lowerCaseTable

--
Met vriendelijke groet,
Henk-Jan van Tuyl


--
http://Van.Tuyl.eu/
--

Using Opera's revolutionary e-mail client:
https://secure.bmtmicro.com/opera/buy-opera.html?AID=789433

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to