Skip to content

Commit 63d8672

Browse files
committed
Move print helpers up to the function that uses it
1 parent 8e08131 commit 63d8672

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
@@ -192,6 +192,20 @@ writeExports path exports =
192192
let path' = if takeExtension path == ".js" then dropExtension path else path
193193
in writeFileD (path' ++ ".exports") (intercalate "\n" exports)
194194

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

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

0 commit comments

Comments
 (0)