# File stringify.hs created by [add --exact-version option to darcs which gives its precise version. # David Roundy **20040730104030] as ./stringify.hs # Following line added by [add --exact-version option to darcs which gives its precise version. # David Roundy **20040730104030] module Main where # Following line added by [add --exact-version option to darcs which gives its precise version. # David Roundy **20040730104030] # Following line added by [No need to use C for Context # Ian Lynagh **20050409145935] import Data.List (intersperse) # Following line added by [No need to use C for Context # Ian Lynagh **20050409145935] import System.Environment (getArgs) # Following line added by [No need to use C for Context # Ian Lynagh **20050409145935] import System.IO (hGetContents, stdin) # Following line added by [add --exact-version option to darcs which gives its precise version. # David Roundy **20040730104030] # Following line added by [add --exact-version option to darcs which gives its precise version. # David Roundy **20040730104030] main :: IO () # Following line added by [No need to use C for Context # Ian Lynagh **20050409145935] main = do [modulename, varname] <- getArgs # Following line added by [add --exact-version option to darcs which gives its precise version. # David Roundy **20040730104030] thedata <- hGetContents stdin # Following line added by [fix newlines in stringify. # David Roundy **20050409154243] let pretty_data = concat $ intersperse "\\n\\\n \\" # Following line added by [No need to use C for Context # Ian Lynagh **20050409145935] $ map (init . tail . show) $ lines thedata # Following line added by [No need to use C for Context # Ian Lynagh **20050409145935] putStrLn $ "module " ++ modulename ++ " (" ++ varname ++ ") where" # Following line added by [No need to use C for Context # Ian Lynagh **20050409145935] putStrLn $ varname ++ " :: String" # Following line added by [No need to use C for Context # Ian Lynagh **20050409145935] putStrLn $ varname ++ " = \"" ++ pretty_data ++ "\"" # Following line added by [No need to use C for Context # Ian Lynagh **20050409145935]