From 93dccd42fe46b5ce4b6ef3bd01920bcc89cfd4e5 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Thu, 5 May 2016 18:27:50 +0200 Subject: [PATCH] Improve haddock docstrings --- src/Alea/Diceware.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Alea/Diceware.hs b/src/Alea/Diceware.hs index 3b8a9bf..763c4fc 100644 --- a/src/Alea/Diceware.hs +++ b/src/Alea/Diceware.hs @@ -1,5 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} +-- | Diceware dictionary interface module Alea.Diceware where import Data.Monoid ((<>)) @@ -13,7 +14,8 @@ import qualified Data.Text as T type Diceware = [Text] --- | Produces k random indices to be extracted +-- | @Randindices n k@ produces @k@ random indices of words +-- to be extracted from a 'Diceware' of @n@ words randIndices :: Int -> Int -> IO [Int] randIndices n k = take k <$> randomRs (0, n-1) <$> newStdGen @@ -36,6 +38,7 @@ readDiceware' d n = d !! n -- | Dice numbers to numbers +-- -- > fromDice 11121 == Just 6 fromDice :: Int -> Maybe Int fromDice n = elemIndex n (filter isDice [11111..66666])