diff --git a/Alea/Diceware.hs b/Alea/Diceware.hs index 0311cac..1f3fa7e 100644 --- a/Alea/Diceware.hs +++ b/Alea/Diceware.hs @@ -13,9 +13,9 @@ parseDiceware x = map (last . split ' ') $ lines x -- Lookup word with dice index readDiceware :: Diceware -> Int -> String readDiceware d n = show n ++ " -> " ++ - case (undice n) of - Just x -> d !! x - Nothing -> "Does not exist" + case (undice n) of + Just x -> d !! x + Nothing -> "Does not exist" -- Lookup word with linear index readDiceware' :: Diceware -> Int -> String @@ -25,4 +25,4 @@ readDiceware' d n = d !! n -- Ex. undice 11121 == Just 6 undice :: Int -> Maybe Int undice n = elemIndex n . filter - (null . (intersect "0789") . show) $ [11111..66666] + (null . (intersect "0789") . show) $ [11111..66666] diff --git a/Alea/List.hs b/Alea/List.hs index 844f63f..f1c35dd 100644 --- a/Alea/List.hs +++ b/Alea/List.hs @@ -5,7 +5,6 @@ module Alea.List where split :: (Eq a) => a -> [a] -> [[a]] split _ [] = [[]] split delim (c:cs) - | c == delim = [] : rest - | otherwise = (c : head rest) : tail rest - where - rest = split delim cs + | c == delim = [] : rest + | otherwise = (c : head rest) : tail rest + where rest = split delim cs diff --git a/README.md b/README.md index 9ff6339..461a83e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Example usage: $ alea doso epurai usci selve dirupo bs - $ alea --phrases 3 --phraselength 8 + $ alea -p 3 -l 8 sturai sapone ripeto leghi osasse fori terme oserai carta getto osiamo banale figura smilzi celibe gigli porvi rs traini dotati aureo solito malato gelate