packages feed

madlang 3.0.0.0 → 3.0.0.1

raw patch · 3 files changed

+3/−2 lines, 3 files

Files

madlang.cabal view
@@ -1,5 +1,5 @@ name:                madlang-version:             3.0.0.0+version:             3.0.0.1 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/Parse.hs view
@@ -99,7 +99,7 @@ modifier :: Parser (T.Text -> T.Text) modifier = do     char '.'-    str <- foldr ((<|>) . try . string) (pure "") ["to_upper", "to_lower", "reverse", "reverse_words", "oulipo", "capitalize"]+    str <- foldr ((<|>) . try . string) (pure "") ["to_upper", "to_lower", "reverse", "reverse_words", "oulipo", "capitalize", "titlecase"]     pure (fromMaybe id (M.lookup (T.unpack str) modifierList)) <?> "modifier"  -- | Parse template into a `PreTok` of referents and strings
src/Text/Madlibs/Ana/ParseUtils.hs view
@@ -32,6 +32,7 @@     , ("to_lower", T.map toLower)     , ("capitalize", \t -> toUpper (T.head t) `T.cons` T.tail t)     , ("reverse", T.reverse)+    , ("titlecase", T.unwords . fmap (\t -> toUpper (T.head t) `T.cons` (T.tail t)) . T.words)     , ("reverse_words", T.unwords . reverse . T.words)     , ("oulipo", T.filter (/='e'))]