Permalink
Browse files

Site updated at 2012-01-03 07:58:17 UTC

  • Loading branch information...
1 parent 6018835 commit 78d74de695bc4dd5226bcfefa907b5a605c803a2 @norm2782 committed Jan 3, 2012
View
@@ -4,7 +4,7 @@
<title><![CDATA[Norm 2782]]></title>
<link href="http://norm2782.github.com/atom.xml" rel="self"/>
<link href="http://norm2782.github.com/"/>
- <updated>2012-01-03T08:54:25+01:00</updated>
+ <updated>2012-01-03T08:58:14+01:00</updated>
<id>http://norm2782.github.com/</id>
<author>
<name><![CDATA[Jurriën Stutterheim]]></name>
@@ -4,7 +4,7 @@
<title><![CDATA[Category: digestive-functors | Norm 2782]]></title>
<link href="http://norm2782.github.com/blog/categories/digestive-functors/atom.xml" rel="self"/>
<link href="http://norm2782.github.com/"/>
- <updated>2012-01-03T08:54:25+01:00</updated>
+ <updated>2012-01-03T08:58:14+01:00</updated>
<id>http://norm2782.github.com/</id>
<author>
<name><![CDATA[Jurriën Stutterheim]]></name>
@@ -4,7 +4,7 @@
<title><![CDATA[Category: Haskell | Norm 2782]]></title>
<link href="http://norm2782.github.com/blog/categories/haskell/atom.xml" rel="self"/>
<link href="http://norm2782.github.com/"/>
- <updated>2012-01-03T08:54:25+01:00</updated>
+ <updated>2012-01-03T08:58:14+01:00</updated>
<id>http://norm2782.github.com/</id>
<author>
<name><![CDATA[Jurriën Stutterheim]]></name>
@@ -4,7 +4,7 @@
<title><![CDATA[Category: Heist | Norm 2782]]></title>
<link href="http://norm2782.github.com/blog/categories/heist/atom.xml" rel="self"/>
<link href="http://norm2782.github.com/"/>
- <updated>2012-01-03T08:54:25+01:00</updated>
+ <updated>2012-01-03T08:58:14+01:00</updated>
<id>http://norm2782.github.com/</id>
<author>
<name><![CDATA[Jurriën Stutterheim]]></name>
@@ -4,7 +4,7 @@
<title><![CDATA[Category: Snap | Norm 2782]]></title>
<link href="http://norm2782.github.com/blog/categories/snap/atom.xml" rel="self"/>
<link href="http://norm2782.github.com/"/>
- <updated>2012-01-03T08:54:25+01:00</updated>
+ <updated>2012-01-03T08:58:14+01:00</updated>
<id>http://norm2782.github.com/</id>
<author>
<name><![CDATA[Jurriën Stutterheim]]></name>
View
@@ -14,6 +14,6 @@
</url>
<url>
<loc>http://norm2782.github.com/snaplet-hdbc.html</loc>
- <lastmod>2012-01-03T08:46:24+01:00</lastmod>
+ <lastmod>2012-01-03T08:57:52+01:00</lastmod>
</url>
</urlset>
View
@@ -132,6 +132,7 @@ <h1 class="entry-title">HDBC Snaplet Tutorial</h1>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
<span class='line-number'>22</span>
+<span class='line-number'>23</span>
</pre></td><td class='code'><pre><code class='haskell'><span class='line'><span class="o">&gt;</span> <span class="cm">{-# LANGUAGE TemplateHaskell #-}</span>
</span><span class='line'><span class="o">&gt;</span> <span class="cm">{-# LANGUAGE FlexibleInstances #-}</span>
</span><span class='line'><span class="o">&gt;</span> <span class="cm">{-# LANGUAGE MultiParamTypeClasses #-}</span>
@@ -144,6 +145,7 @@ <h1 class="entry-title">HDBC Snaplet Tutorial</h1>
</span><span class='line'><span class="o">&gt;</span> <span class="kr">import</span> <span class="nn">Data.ByteString.Char8</span> <span class="p">(</span><span class="kt">ByteString</span><span class="p">)</span>
</span><span class='line'><span class="o">&gt;</span> <span class="kr">import</span> <span class="k">qualified</span> <span class="nn">Data.ByteString.Char8</span> <span class="k">as</span> <span class="n">BS</span>
</span><span class='line'><span class="o">&gt;</span> <span class="kr">import</span> <span class="nn">Data.Lens.Template</span>
+</span><span class='line'><span class="o">&gt;</span> <span class="kr">import</span> <span class="nn">Data.Map</span> <span class="p">((</span><span class="o">!</span><span class="p">))</span>
</span><span class='line'><span class="o">&gt;</span> <span class="kr">import</span> <span class="nn">Data.Maybe</span>
</span><span class='line'><span class="o">&gt;</span> <span class="kr">import</span> <span class="nn">Data.String</span>
</span><span class='line'><span class="o">&gt;</span> <span class="kr">import</span> <span class="nn">Database.HDBC.Sqlite3</span>
@@ -309,7 +311,7 @@ <h1 class="entry-title">HDBC Snaplet Tutorial</h1>
</span><span class='line'><span class="o">&gt;</span> <span class="n">rows</span> <span class="ow">&lt;-</span> <span class="n">query</span> <span class="s">&quot;SELECT * FROM messages WHERE somenum = ?&quot;</span> <span class="p">[</span><span class="n">toSql</span> <span class="n">n</span><span class="p">]</span>
</span><span class='line'><span class="o">&gt;</span> <span class="n">return</span> <span class="o">$</span> <span class="n">map</span> <span class="n">toMsg</span> <span class="n">rows</span>
</span><span class='line'><span class="o">&gt;</span> <span class="kr">where</span> <span class="n">toMsg</span> <span class="ow">::</span> <span class="kt">Row</span> <span class="ow">-&gt;</span> <span class="kt">Message</span>
-</span><span class='line'><span class="o">&gt;</span> <span class="n">toMsg</span> <span class="ow">=</span> <span class="n">undefined</span>
+</span><span class='line'><span class="o">&gt;</span> <span class="n">toMsg</span> <span class="n">rw</span> <span class="ow">=</span> <span class="kt">Message</span> <span class="o">$</span> <span class="n">fromSql</span> <span class="p">(</span><span class="n">rw</span> <span class="o">!</span> <span class="s">&quot;msgcol&quot;</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>

0 comments on commit 78d74de

Please sign in to comment.