fixed the doctests
This commit is contained in:
parent
7b5f8862ed
commit
1372c2470e
4 changed files with 28 additions and 8 deletions
13
shell.nix
Normal file
13
shell.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
let
|
||||
rev = "16d475334409f7fa632929b2838421b4ffe34927";
|
||||
_nixpkgs = import <nixpkgs> { };
|
||||
pkgs = import ( fetchTarball "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz" ) { };
|
||||
ghc = pkgs.haskellPackages;
|
||||
ghcPackages = ghc.ghcWithPackages (ps: [ ps.protolude ps.turtle ]);
|
||||
in with pkgs;
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "gpm";
|
||||
buildInputs = [ ghcPackages ];
|
||||
buildDepends = [ libiconv ];
|
||||
}
|
|
@ -4,4 +4,11 @@ import System.FilePath.Glob
|
|||
import Test.DocTest
|
||||
|
||||
main :: IO ()
|
||||
main = glob "src/**/*.hs" >>= doctest
|
||||
main = do
|
||||
files <- glob "src/**/*.hs"
|
||||
doctest (params <> files)
|
||||
where
|
||||
params = [ "-XOverloadedStrings"
|
||||
, "-XNoImplicitPrelude"
|
||||
, "-XScopedTypeVariables"
|
||||
]
|
||||
|
|
|
@ -32,8 +32,8 @@ data AppOptions = AppOptions { genMode :: GenMode
|
|||
|
||||
optParser :: Parser AppOptions
|
||||
optParser = AppOptions
|
||||
<$> (fromMaybe Short <$> optional (opt toGenMode "gen" 'g' "Possible values: short, dict"))
|
||||
<*> optional (optPath "dict" 'd' "dictionary (predefined names are: english, first-names, generic, literary) or use any file path (one word per line)")
|
||||
<$> (fromMaybe Short <$> optional (opt toGenMode "gen" 'g' "Possible values: short, lovecraftian, dict"))
|
||||
<*> optional (optPath "dict" 'd' "dictionary file path (the file should contain one word per line)")
|
||||
<*> optional (optInt "len" 'n' "complexity depends on the gen chosen")
|
||||
|
||||
toGenMode :: Text -> Maybe GenMode
|
||||
|
|
|
@ -17,10 +17,10 @@ where
|
|||
|
||||
import Protolude
|
||||
|
||||
import qualified System.Random.MWC as Random
|
||||
import qualified Control.Monad.Primitive as Prim
|
||||
import qualified Data.Vector as V
|
||||
import Data.Vector ((!))
|
||||
import qualified Data.Vector as V
|
||||
import qualified System.Random.MWC as Random
|
||||
|
||||
import qualified Data.Text as Text
|
||||
|
||||
|
|
Loading…
Reference in a new issue