]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - examples/HelloWorld.hs
examples/*.hs should use mimeType quasi-quoter.
[Lucu.git] / examples / HelloWorld.hs
index d7e0071c8767f72caf9e9bc72c0ef08e748c3b66..f8a4721dca6c5503a31e50715e69e43d0c0c2273 100644 (file)
@@ -1,5 +1,6 @@
 {-# LANGUAGE
     OverloadedStrings
+  , QuasiQuotes
   , UnicodeSyntax
   #-}
 import Control.Applicative
@@ -26,7 +27,7 @@ helloWorld ∷ ResourceDef
 helloWorld
     = emptyResource {
         resGet
-          = Just $ do setContentType $ parseMIMEType "text/hello"
+          = Just $ do setContentType [mimeType| text/hello |]
                       putChunk "Hello, "
                       putChunk "World!\n"
                       putChunks =≪ Lazy.pack <$> getRemoteAddr'
@@ -34,6 +35,6 @@ helloWorld
           = Just $ do str1 ← getChunk 3
                       str2 ← getChunk 3
                       str3 ← getChunk 3
-                      setContentType $ parseMIMEType "text/hello"
+                      setContentType [mimeType| text/hello |]
                       putChunks $ Lazy.fromChunks ["[", str1, " - ", str2, "#", str3, "]"]
       }