Skip to content

Commit c2dbc95

Browse files
committed
Move print helpers up to the function that uses it
1 parent 7aecf4b commit c2dbc95

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

compiler/app/Main.hs

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,20 @@ writeExports path exports =
191191
let path' = if takeExtension path == ".js" then dropExtension path else path
192192
in writeFileD (path' ++ ".exports") (intercalate "\n" exports)
193193

194+
-- Utility functions for printing things out
195+
hrWidth = 70
196+
197+
printSep :: String -> IO ()
198+
printSep s = do
199+
let prefix = replicate 5 '-'
200+
suffix = replicate (hrWidth - length s - 5 - 2) '-'
201+
s' = prefix ++ " " ++ s ++ " " ++ suffix
202+
putStrLn s'
203+
204+
205+
printHr :: IO ()
206+
printHr = putStrLn (replicate hrWidth '-')
207+
194208
--------------------------------------------------------------------------------
195209
----- DESERIALIZATION FOR INTERACTIVE MODES ------------------------------------
196210

@@ -253,21 +267,3 @@ main = do
253267
-- certain options must not be combined
254268
not.or $ map (`elem` o) [TextIRMode, Help]
255269
optionsOK _ = True
256-
257-
258-
-- utility functions for printing things out
259-
260-
hrWidth = 70
261-
262-
printSep :: String -> IO ()
263-
printSep s = do
264-
let prefix = replicate 5 '-'
265-
suffix = replicate (hrWidth - length s - 5 - 2) '-'
266-
s' = prefix ++ " " ++ s ++ " " ++ suffix
267-
putStrLn s'
268-
269-
270-
printHr :: IO ()
271-
printHr = putStrLn (replicate hrWidth '-')
272-
273-
--------------------------------------------------

0 commit comments

Comments
 (0)