Haskell: HStringTemplate inheritance example?

I'm going a little nuts trying to figure out how to use template inheritance in the Haskell HStringTemplate. Using a basic template is simple enough, but there is no inheritance. Can someone point me to a decent example? The following document is not enough to move to a more advanced use.

http://www.haskell.org/haskellwiki/HStringTemplate <- Without help !!

+4
source share
1 answer

Good, finally understood. You would not believe how long I looked at the Hackage docs trying to put this together. Here's a far-fetched example for those of you who are following him:

let p = newSTMP "Parent --> $child()$" :: StringTemplate String let c = newSTMP "Child --> Your content Here." :: StringTemplate String let grp = groupStringTemplates [("parent", p),("child", c)] putStrLn $ toString $ fromJust $ getStringTemplate "parent" grp 

Fingerprints:

 Parent --> Child --> Your content Here. 

I will add that I think that some of my difficulties are related to the fact that I am not so familiar with Java StringTemplate. I'm still not sure to what extent the Haskell package emulates Java.

+5
source

All Articles