
I hate constructing strings with ++. Especially icky when you start dealing with escape characters and stuff. cabal install HStringTemplateHelpers ..... import Text.StringTemplate.Helpers putStrLn $ render1 [("name",name)] "Why, hello, $name$" just thinkin out loud :) (originally at http://www.reddit.com/r/programming/comments/7khkd/the_fun_of_programming_a_...)

Correction:
name = "Bill" import Text.StringTemplate.Helpers putStrLn $ render1 [("name",name)] "Why, hello, $name$"
2008/12/20 Thomas Hartman
I hate constructing strings with ++. Especially icky when you start dealing with escape character and stuff.
cabal install HStringTemplateHelpers
.....
import Text.StringTemplate.Helpers putStrLn $ render1 [("name",name)] "Why, hello, $name$"
just thinkin out loud :)
(originally at http://www.reddit.com/r/programming/comments/7khkd/the_fun_of_programming_a_...)

On Sat, Dec 20, 2008 at 4:15 PM, Thomas Hartman
I hate constructing strings with ++. Especially icky when you start dealing with escape characters and stuff.
cabal install HStringTemplateHelpers
.....
import Text.StringTemplate.Helpers putStrLn $ render1 [("name",name)] "Why, hello, $name$"
I once wrote a simple library for "classical" $-substitution. I plan to upgrade it to use Data.Text (efficient bytestring like representation for Unicode strings) whenever that's release. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/template Cheers, Johan
participants (2)
-
Johan Tibell
-
Thomas Hartman