From 73093e4e29e783bd53627c4eeae9a782d172ae76 Mon Sep 17 00:00:00 2001 From: Michele Guerini Rocco Date: Sat, 13 Dec 2014 01:03:43 +0100 Subject: [PATCH] Fix whitespace mess --- main.hs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/main.hs b/main.hs index 21b9f0c..6024b4c 100644 --- a/main.hs +++ b/main.hs @@ -10,11 +10,11 @@ import Alea.Diceware import Alea.Random data ProgArgs = ProgArgs - { interactive :: Bool - , dictionary :: FilePath - , phraseLength :: Int - , phrases :: Int - } deriving (Show) + { interactive :: Bool + , dictionary :: FilePath + , phraseLength :: Int + , phrases :: Int + } deriving (Show) parser :: IO (ParserSpec ProgArgs) parser = path >>= \path -> return $ ProgArgs @@ -44,12 +44,12 @@ readDict args@ProgArgs{..} = -- Main function exec :: ProgArgs -> IO () exec args@ProgArgs{..} = - if interactive - then interact (unlines . map dice . lines) - else do - randWords dictSize phraseLength >>= putStrLn . unwords . map dice' - when (phrases > 1) $ exec args {phrases = phrases - 1} - where - (dict, dictSize) = (parseDiceware dictionary, length dict) - dice n = readDiceware dict (read n :: Int) - dice' n = readDiceware' dict n \ No newline at end of file + if interactive + then interact (unlines . map dice . lines) + else do + randWords dictSize phraseLength >>= putStrLn . unwords . map dice' + when (phrases > 1) $ exec args {phrases = phrases - 1} + where + (dict, dictSize) = (parseDiceware dictionary, length dict) + dice n = readDiceware dict (read n :: Int) + dice' n = readDiceware' dict n