madlang 2.3.0.4 → 2.3.0.5
raw patch · 14 files changed
+45/−39 lines, 14 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- default.nix +5/−5
- madlang.cabal +7/−5
- src/Text/Madlibs.hs +0/−2
- src/Text/Madlibs/Ana/Parse.hs +6/−4
- src/Text/Madlibs/Ana/ParseUtils.hs +8/−2
- src/Text/Madlibs/Ana/Resolve.hs +5/−3
- src/Text/Madlibs/Cata/Display.hs +1/−1
- src/Text/Madlibs/Cata/Run.hs +1/−1
- src/Text/Madlibs/Cata/SemErr.hs +6/−4
- src/Text/Madlibs/Exec/Main.hs +2/−3
- src/Text/Madlibs/Generate/TH.hs +1/−3
- src/Text/Madlibs/Internal/Types.hs +0/−3
- src/Text/Madlibs/Internal/Utils.hs +0/−2
- test/Demo.hs +3/−1
default.nix view
@@ -1,18 +1,18 @@ { mkDerivation, ansi-wl-pprint, base, composition, containers-, directory, file-embed-poly, hspec, hspec-megaparsec, megaparsec+, directory, file-embed, hspec, hspec-megaparsec, megaparsec , microlens, MonadRandom, mtl, optparse-applicative, random-shuffle , stdenv, template-haskell, text }: mkDerivation { pname = "madlang";- version = "2.3.0.3";+ version = "2.3.0.4"; src = ./.; isLibrary = true; isExecutable = true; libraryHaskellDepends = [- ansi-wl-pprint base composition containers directory- file-embed-poly megaparsec microlens MonadRandom mtl- optparse-applicative random-shuffle template-haskell text+ ansi-wl-pprint base composition containers directory file-embed+ megaparsec microlens MonadRandom mtl optparse-applicative+ random-shuffle template-haskell text ]; executableHaskellDepends = [ base ]; testHaskellDepends = [
madlang.cabal view
@@ -1,5 +1,5 @@ name: madlang-version: 2.3.0.4+version: 2.3.0.5 synopsis: Randomized templating language DSL description: Please see README.md homepage: https://github.com/vmchale/madlang#readme@@ -59,13 +59,15 @@ , DeriveGeneric , DeriveFunctor , DeriveAnyClass+ ghc-options: -fwarn-unused-imports+ -- -fwarn-unused-binds executable madlang hs-source-dirs: app main-is: Main.hs if flag(llvm-fast) ghc-options: -threaded -static -fllvm -optlo-O3 -O3----optc-static -optl-static + -- -optc-static -optl-static else ghc-options: -threaded -rtsopts -with-rtsopts=-N build-depends: base@@ -82,9 +84,9 @@ , megaparsec , text if flag(llvm-fast)- ghc-options: -threaded -fllvm -optlo-O3 -O3+ ghc-options: -threaded -fllvm -optlo-O3 -O3 -fwarn-unused-imports else- ghc-options: -threaded -rtsopts -with-rtsopts=-N -O3+ ghc-options: -threaded -rtsopts -with-rtsopts=-N -O3 -fwarn-unused-imports default-language: Haskell2010 test-suite madlang-test@@ -99,7 +101,7 @@ , text , mtl , hspec-megaparsec- ghc-options: -threaded -rtsopts -with-rtsopts=-N + ghc-options: -threaded -rtsopts -with-rtsopts=-N -fwarn-unused-imports default-language: Haskell2010 source-repository head
src/Text/Madlibs.hs view
@@ -42,10 +42,8 @@ import Text.Madlibs.Ana.Resolve import Text.Madlibs.Ana.Parse-import Text.Madlibs.Ana.ParseUtils import Text.Madlibs.Cata.Run import Text.Madlibs.Cata.SemErr import Text.Madlibs.Exec.Main import Text.Madlibs.Internal.Types-import Text.Madlibs.Internal.Utils import Text.Madlibs.Generate.TH
src/Text/Madlibs/Ana/Parse.hs view
@@ -1,5 +1,10 @@ -- | Parse our DSL-module Text.Madlibs.Ana.Parse where+module Text.Madlibs.Ana.Parse (+ parseTok+ , parseTokF+ , parseInclusions+ , parseTreeF+ , parseTokM ) where import Text.Madlibs.Internal.Types import Text.Madlibs.Internal.Utils@@ -8,13 +13,10 @@ import qualified Data.Text as T import Text.Megaparsec import Text.Megaparsec.Text-import Text.Megaparsec.Char import qualified Text.Megaparsec.Lexer as L-import Data.Monoid import Control.Monad import qualified Data.Map as M import Control.Monad.State-import Control.Exception hiding (try) import Data.Composition import Data.Maybe
src/Text/Madlibs/Ana/ParseUtils.hs view
@@ -1,5 +1,12 @@ -- | Helper functions to sort out parsing-module Text.Madlibs.Ana.ParseUtils where+module Text.Madlibs.Ana.ParseUtils (+ modifierList+ , strip+ , takeTemplate+ , sortKeys+ , build+ , buildTree+ ) where import Text.Madlibs.Internal.Types import Text.Madlibs.Internal.Utils@@ -8,7 +15,6 @@ import qualified Data.Text as T import Control.Monad.State import Data.Foldable-import Control.Exception import Control.Arrow import System.Random.Shuffle import qualified Data.Map as M
src/Text/Madlibs/Ana/Resolve.hs view
@@ -1,7 +1,11 @@ {-# LANGUAGE FlexibleContexts #-} -- | Module containing IO stuff to get/parse files with external dependencies-module Text.Madlibs.Ana.Resolve where+module Text.Madlibs.Ana.Resolve (+ parseFile + , runFile+ , makeTree + , runText ) where import qualified Data.Text as T import Text.Megaparsec@@ -14,8 +18,6 @@ import System.Directory import Lens.Micro import Data.Monoid-import Control.Applicative-import Control.Monad import Control.Monad.Random.Class -- | Parse a template file into the `RandTok` data type
src/Text/Madlibs/Cata/Display.hs view
@@ -1,5 +1,5 @@ -- | Module with helper functions for displaying the parsed tree-module Text.Madlibs.Cata.Display where+module Text.Madlibs.Cata.Display (displayTree) where import Data.Tree import Text.Madlibs.Internal.Types
src/Text/Madlibs/Cata/Run.hs view
@@ -1,5 +1,5 @@ -- | Module containing functions to get `Text` from `RandTok`-module Text.Madlibs.Cata.Run where+module Text.Madlibs.Cata.Run (run) where import Text.Madlibs.Internal.Types import Text.Madlibs.Internal.Utils
src/Text/Madlibs/Cata/SemErr.hs view
@@ -1,20 +1,22 @@ {-# LANGUAGE FlexibleContexts #-} -- | Module defining the SemErr data type-module Text.Madlibs.Cata.SemErr where+module Text.Madlibs.Cata.SemErr (+ SemanticError (..)+ , access+ , checkSemantics+ , head' ) where + import Text.Madlibs.Internal.Types import Data.Typeable import Text.PrettyPrint.ANSI.Leijen import Control.Exception import qualified Data.Text as T import Control.Monad-import Lens.Micro-import Lens.Micro.Extras import qualified Data.Set as S import Text.Megaparsec.Text import Text.Megaparsec.Prim-import Data.Composition import Text.Megaparsec.Error import Text.Madlibs.Internal.Utils
src/Text/Madlibs/Exec/Main.hs view
@@ -1,10 +1,10 @@ -- | Provides `madlang` runMadlangutable-module Text.Madlibs.Exec.Main where+module Text.Madlibs.Exec.Main (+ runMadlang ) where import Control.Monad import Text.Madlibs.Ana.Resolve import Text.Madlibs.Cata.Display-import Text.Madlibs.Internal.Types import Text.Madlibs.Internal.Utils import qualified Data.Text as T import qualified Data.Text.IO as TIO@@ -12,7 +12,6 @@ import Options.Applicative hiding (ParseError) import Data.Monoid import Data.Maybe-import Data.Composition import System.Directory import Paths_madlang import Data.Version
src/Text/Madlibs/Generate/TH.hs view
@@ -2,15 +2,13 @@ -- | Module containing Quasi-Quoter and Template Haskell splice for use as an EDSL. module Text.Madlibs.Generate.TH - ( textToExpression- , madFile+ ( madFile , madlang ) where import Language.Haskell.TH hiding (Dec) import qualified Data.Text as T import Text.Madlibs.Ana.Parse-import Text.Madlibs.Ana.Resolve import Text.Madlibs.Internal.Utils import Language.Haskell.TH.Quote import Data.FileEmbed
src/Text/Madlibs/Internal/Types.hs view
@@ -6,11 +6,8 @@ import qualified Data.Text as T import Control.Monad.State-import Data.Functor.Identity import Lens.Micro import Data.Function-import Data.Monoid-import Data.Tree -- | datatype for a double representing a probability type Prob = Double
src/Text/Madlibs/Internal/Utils.hs view
@@ -5,10 +5,8 @@ module Text.Madlibs.Internal.Utils where import Text.Madlibs.Internal.Types-import Text.Megaparsec.Text import Text.Megaparsec.Error import qualified Data.Text as T-import System.IO.Unsafe import Lens.Micro -- | Drop file Extension
test/Demo.hs view
@@ -1,7 +1,9 @@ {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE QuasiQuotes #-} -module Demo where +module Demo (+ runTest+ , runTestQQ ) where import Text.Madlibs import qualified Data.Text as T