packages feed

hamlet 1.1.7.5 → 1.1.7.6

raw patch · 2 files changed

+20/−2 lines, 2 filesdep ~shakespeare

Dependency ranges changed: shakespeare

Files

hamlet.cabal view
@@ -1,5 +1,5 @@ name:            hamlet-version:         1.1.7.5+version:         1.1.7.6 license:         MIT license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>@@ -42,7 +42,7 @@  library     build-depends:   base             >= 4       && < 5-                   , shakespeare      >= 1.0.1   && < 1.3+                   , shakespeare      >= 1.2.0.4 && < 1.3                    , bytestring       >= 0.9                    , template-haskell                    , parsec           >= 2       && < 4
test/HamletTest.hs view
@@ -464,6 +464,24 @@                     bar
             |]
 
+    it "list syntax" $
+        helper "123"
+            [hamlet|
+                $forall x <- []
+                    ignored
+                $forall x <- [1, 2, 3]
+                    #{show x}
+            |]
+
+    it "list in attribute" $
+        let myShow :: [Int] -> String
+            myShow = show
+         in helper "<a href=\"[]\">foo</a>\n<a href=\"[1,2]\">bar</a>\n"
+            [hamlet|
+                <a href=#{myShow []}>foo
+                <a href=#{myShow [1, 2]}>bar
+            |]
+
 data Pair = Pair String Int
 
 data Url = Home | Sub SubUrl