From 6c51f66c59f7c78d3bf56bc1db435b3e3566c9bc Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Thu, 28 Apr 2016 14:17:43 +0200 Subject: [PATCH] Replace tabs --- src/main.hs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main.hs b/src/main.hs index 97acbf6..f987229 100644 --- a/src/main.hs +++ b/src/main.hs @@ -9,11 +9,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 -> 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