packages feed

madlang 0.1.0.1 → 0.1.0.2

raw patch · 6 files changed

+38/−14 lines, 6 filesdep ~basedep ~madlang

Dependency ranges changed: base, madlang

Files

app/Main.hs view
@@ -1,6 +1,6 @@ module Main where -import Text.Madlibs (exec)+import Text.Madlibs (runMadlang)  main :: IO ()-main = exec+main = runMadlang
madlang.cabal view
@@ -1,5 +1,5 @@ name: madlang-version: 0.1.0.1+version: 0.1.0.2 cabal-version: >=1.10 build-type: Simple license: BSD3@@ -15,6 +15,7 @@ author: Vanessa McHale extra-source-files:     README.md+    test/templates/*.mad  source-repository head     type: git@@ -48,18 +49,18 @@ executable madlang     main-is: Main.hs     build-depends:-        base >=4.9.0.0 && <4.10,-        madlang >=0.1.0.1 && <0.2+        base >=4.9.1.0 && <4.10,+        madlang >=0.1.0.2 && <0.2     default-language: Haskell2010     hs-source-dirs: app-    ghc-options: -threaded -rtsopts -with-rtsopts=-N+    ghc-options: -threaded -rtsopts -with-rtsopts=-N -O3 -fllvm  test-suite madlang-test     type: exitcode-stdio-1.0     main-is: Spec.hs     build-depends:-        base >=4.9.0.0 && <4.10,-        madlang >=0.1.0.1 && <0.2,+        base >=4.9.1.0 && <4.10,+        madlang >=0.1.0.2 && <0.2,         hspec >=2.2.4 && <2.3,         megaparsec >=5.0.1 && <5.1,         text >=1.2.2.1 && <1.3,@@ -67,4 +68,4 @@         hspec-megaparsec >=0.2.1 && <0.3     default-language: Haskell2010     hs-source-dirs: test-    ghc-options: -threaded -rtsopts -with-rtsopts=-N+    ghc-options: -threaded -rtsopts -with-rtsopts=-N -O3 -fllvm
src/Text/Madlibs.hs view
@@ -11,8 +11,8 @@                     -- * Types associated with the parser                     , Context                     , SemanticError (..)-                    -- * Command-line executable-                    , exec+                    -- * Command-line runMadlangutable+                    , runMadlang                     ) where  import Text.Madlibs.Ana.Parse
src/Text/Madlibs/Exec/Main.hs view
@@ -2,7 +2,7 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} --- | Provides `madlang` executable+-- | Provides `madlang` runMadlangutable module Text.Madlibs.Exec.Main where  import Text.Madlibs.Cata.Run@@ -24,8 +24,8 @@ instance ParseRecord Program where  -- | Main program action-exec :: IO ()-exec = do+runMadlang :: IO ()+runMadlang = do     x <- getRecord "Text.Madlibs templating DSL"     case unHelpful . rep $ x of         (Just n) -> sequence_ . (take n) . repeat $ template x
+ test/templates/fortune-teller.mad view
@@ -0,0 +1,18 @@+:define person+    0.7 "A close friend will "+    0.3 "You will "+:define goodfortune+    0.1 person "make rain on the planet Mars"+    0.9 "nice things will happen today :)"+:define fortune+    0.5 "drink a boatload of milk"+    0.5 "get h*ckin angry for no reason"+:return+    0.8 person fortune+    0.2 goodfortune+{#+:define copies+    :replicate person+        (1) 0.3+        (2) 0.7+#}
+ test/templates/gambling.mad view
@@ -0,0 +1,5 @@+:define something+    0.5 "heads"+    0.5 "tails"+:return+    1.0 something