diff --git a/Text/Hamlet/Quasi.hs b/Text/Hamlet/Quasi.hs
--- a/Text/Hamlet/Quasi.hs
+++ b/Text/Hamlet/Quasi.hs
@@ -20,11 +20,17 @@
 docsToExp :: Exp -> Scope -> [Doc] -> Q Exp
 docsToExp render scope docs = do
     exps <- mapM (docToExp render scope) docs
-    ma <- [|mappend|]
     me <- [|mempty|]
-    return $ if null exps then me else foldr1 (go ma) exps
-  where
-    go ma x y = ma `AppE` x `AppE` y
+    return $
+        case exps of
+            [] -> me
+            [x] -> x
+            _ ->
+                let x = init exps
+                    y = last exps
+                    x' = map (BindS WildP) x
+                    y' = NoBindS y
+                 in DoE $ x' ++ [y']
 
 docToExp :: Exp -> Scope -> Doc -> Q Exp
 docToExp render scope (DocForall list ident@(Ident name) inside) = do
diff --git a/hamlet.cabal b/hamlet.cabal
--- a/hamlet.cabal
+++ b/hamlet.cabal
@@ -1,5 +1,5 @@
 name:            hamlet
-version:         0.3.1
+version:         0.3.1.1
 license:         BSD3
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
