Created
December 17, 2011 07:39
-
-
Save benkolera/1489588 to your computer and use it in GitHub Desktop.
Perl has broken my brain. This wont work; dummy!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prettyPrintDBInfo :: DBInfo -> String | |
prettyPrintDBInfo (DBInfo dbName (DBOptions useBString _ ) tbls) = unlines [ | |
"DBInfo { ", | |
" dbName = \"" ++ dbName ++ "\"", | |
" , opts = DBOpts { useBString = " ++ (show useBString) ++ " }", | |
" , tbls = [" , | |
(map prettyPrintTableInfo tbls) , | |
" ] ", | |
"}" | |
] | |
prettyPrintTableInfo (TInfo tName cols) = unlines [ | |
" TInfo {" , | |
" tname = \""++ tName ++ "\"", | |
" cols = [", | |
(map (( " " ++ ) . show) cols) , | |
" ]", | |
" }" | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment