Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add compress example

  • Loading branch information...
commit 6090432600e62854f25d53992d3eb13c826d7067 1 parent 02651cf
@xl authored
Showing with 27 additions and 0 deletions.
  1. +27 −0 slide/yesod.html
View
27 slide/yesod.html
@@ -254,6 +254,33 @@
</section>
<section>
+ <h3>锋芒小试 :: 压缩解压缩</h3>
+ <p>代码即文档</p>
+ <div class="fragment">
+ <pre><code class="haskell">
+
+--import qualified Codec.Compression.Zlib
+--import qualified Codec.Compression.Snappy
+
+import qualified Data.ByteString.Lazy as L
+import qualified Codec.Compression.GZip
+
+compress :: L.ByteString -> L.ByteString
+compress = Codec.Compression.GZip.compress
+
+decompress :: L.ByteString -> L.ByteString
+decompress = Codec.Compression.GZip.decompress
+
+main :: IO ()
+main = L.interact compress
+
+-- main = L.interact decompress
+
+ </code> </pre>
+ </div>
+ </section>
+
+ <section>
<h3>Parsec :: 锋芒小试</h3>
<p>告别正则表达式</p>
<p>WTF: "href\s*=\s*(?:""(?&lt1&gt[^""]*)""|(?&lt1&gt\S+))"</p>
Please sign in to comment.
Something went wrong with that request. Please try again.