Skip to content
Browse files

more friendly example

  • Loading branch information...
1 parent df218e6 commit 2d9c4e29346a7d5f421c0d70411a1f8261e83ff8 @lymar lymar committed Jul 11, 2012
Showing with 6 additions and 4 deletions.
  1. +3 −2 README.md
  2. +3 −2 examples/listsByIndex.hs
View
5 README.md
@@ -117,7 +117,7 @@ main = mapM_ (\(template,context) ->
hastacheStr defaultConfig (encodeStr template) context >>= LZ.putStrLn)
[(template1, mkStrContext context1),
(template1, context2),
- (template2, context3)]
+ (template3, context3)]
names = ["Nameless","Long Sky","Flying Snow","Broken Sword","Qin Shi Huang"]
@@ -137,7 +137,8 @@ data Heroes = Heroes { heroes :: [Hero] } deriving (Data, Typeable)
context2 = mkGenericContext $ Heroes $ map Hero names
-template2 = concat [
+-- With Generics (another way)
+template3 = concat [
"{{heroName.3}}\n",
"{{heroName.2}}\n"]
View
5 examples/listsByIndex.hs
@@ -11,7 +11,7 @@ main = mapM_ (\(template,context) ->
hastacheStr defaultConfig (encodeStr template) context >>= LZ.putStrLn)
[(template1, mkStrContext context1),
(template1, context2),
- (template2, context3)]
+ (template3, context3)]
names = ["Nameless","Long Sky","Flying Snow","Broken Sword","Qin Shi Huang"]
@@ -31,7 +31,8 @@ data Heroes = Heroes { heroes :: [Hero] } deriving (Data, Typeable)
context2 = mkGenericContext $ Heroes $ map Hero names
-template2 = concat [
+-- With Generics (another way)
+template3 = concat [
"{{heroName.3}}\n",
"{{heroName.2}}\n"]

0 comments on commit 2d9c4e2

Please sign in to comment.
Something went wrong with that request. Please try again.