packages feed

madlang 2.4.2.6 → 2.4.2.7

raw patch · 2 files changed

+2/−2 lines, 2 files

Files

madlang.cabal view
@@ -1,5 +1,5 @@ name:                madlang-version:             2.4.2.6+version:             2.4.2.7 synopsis:            Randomized templating language DSL description:         Madlang is a text templating language written in Haskell,                      meant to explore computational creativity and generative
src/Text/Madlibs/Ana/Resolve.hs view
@@ -35,7 +35,7 @@ -- | Generate text from file with inclusions getInclusionCtx :: Bool -> [T.Text] -> FilePath -> FilePath -> IO (Either (ParseError Char (ErrorFancy Void)) [(Key, RandTok)]) getInclusionCtx isTree ins folder filepath = do-    libDir <- do { home <- getEnv "HOME" ; if os /= home then pure (home <> "/.madlang") else pure (home <> "\\.madlang") }+    libDir <- do { home <- getEnv "HOME" ; if os /= home then pure (home <> "/.madlang/") else pure (home <> "\\.madlang\\") }     file <- catch (readFile' (folder ++ filepath)) (const (readFile' (libDir <> folder <> filepath)) :: IOException -> IO T.Text)     let filenames = map T.unpack $ either (error . show) id $ parseInclusions filepath file -- TODO pass up errors correctly     let resolveKeys file' = fmap (first ((((T.pack . (<> "-")) . dropExtension) file') <>))