<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>~~</title>
	<atom:link href="http://jartur.l-square.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://jartur.l-square.net</link>
	<description>Blog -&#62; Maybe Blog</description>
	<pubDate>Thu, 17 Jul 2008 13:18:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>LHC activation soon!</title>
		<link>http://jartur.l-square.net/2008/06/lhc-activation-soon/</link>
		<comments>http://jartur.l-square.net/2008/06/lhc-activation-soon/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 05:09:43 +0000</pubDate>
		<dc:creator>jartur</dc:creator>
		
		<category><![CDATA[Nothing]]></category>

		<guid isPermaLink="false">http://jartur.l-square.net/?p=18</guid>
		<description><![CDATA[First collisions are scheduled on the end of June.
The end of Earth is near =)
]]></description>
			<content:encoded><![CDATA[<p>First collisions are scheduled on the end of June.</p>
<p>The end of Earth is near =)</p>
]]></content:encoded>
			<wfw:commentRss>http://jartur.l-square.net/2008/06/lhc-activation-soon/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Links #1</title>
		<link>http://jartur.l-square.net/2008/06/links-1/</link>
		<comments>http://jartur.l-square.net/2008/06/links-1/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 06:16:10 +0000</pubDate>
		<dc:creator>jartur</dc:creator>
		
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://jartur.l-square.net/?p=17</guid>
		<description><![CDATA[Abstract algebra textbook
A free linear algebra text
Elements of Abstract and Linear  Algebra
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.math.uiowa.edu/~goodman/algebrabook.dir/algebrabook.html">Abstract algebra textbook</a><br />
<a href="http://joshua.smcvt.edu/linalg.html/">A free linear algebra text</a><br />
<a href="http://www.math.miami.edu/~ec/book/">Elements of Abstract and Linear  Algebra</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jartur.l-square.net/2008/06/links-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PLT Scheme 4.0 is out!</title>
		<link>http://jartur.l-square.net/2008/06/plt-scheme-40-is-out/</link>
		<comments>http://jartur.l-square.net/2008/06/plt-scheme-40-is-out/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 03:24:07 +0000</pubDate>
		<dc:creator>jartur</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Scheme]]></category>

		<guid isPermaLink="false">http://jartur.l-square.net/?p=16</guid>
		<description><![CDATA[PLT website
Typed Scheme is fun:

[-]View Code SCHEME  #lang typed-scheme
  &#40;define-struct: Nothing &#40;&#41;&#41;
  &#40;define-struct: &#40;a&#41; Just &#40;&#91;v : a&#93;&#41;&#41;  
&#160;
  &#40;define-type-alias &#40;Maybe a&#41; &#40;U Nothing &#40;Just a&#41;&#41;&#41;  
&#160;
  &#40;: find &#40;Number &#40;Listof Number&#41; -&#62; &#40;Maybe Number&#41;&#41;&#41;
  &#40;define &#40;find v l&#41;
  &#40;cond &#91;&#40;null? l&#41; &#40;make-Nothing&#41;&#93;
    [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://plt-scheme.org/">PLT website</a></p>
<p>Typed Scheme is fun:</p>

<div class="wp_codebox_msgheader"><span class="codebox_right"><a href="javascript:;" onclick="toggle_collapse('162');">[<span id="162_symbol">-</span>]</a></span><span class="codebox_left"><span id="l16code2"><a href="javascript:;" onclick="javascript:showCodeTxt('16code2'); return false;">View Code</a> SCHEME</span></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="162"><td class="code" id="16code2"><pre class="scheme">  #lang typed<span style="color: #66cc66;">-</span>scheme
  <span style="color: #66cc66;">&#40;</span>define<span style="color: #66cc66;">-</span>struct: Nothing <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>define<span style="color: #66cc66;">-</span>struct: <span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">&#41;</span> Just <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>v : a<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>  
&nbsp;
  <span style="color: #66cc66;">&#40;</span>define<span style="color: #66cc66;">-</span>type<span style="color: #66cc66;">-</span>alias <span style="color: #66cc66;">&#40;</span>Maybe a<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>U Nothing <span style="color: #66cc66;">&#40;</span>Just a<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>  
&nbsp;
  <span style="color: #66cc66;">&#40;</span>: find <span style="color: #66cc66;">&#40;</span>Number <span style="color: #66cc66;">&#40;</span>Listof Number<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">-&gt;</span> <span style="color: #66cc66;">&#40;</span>Maybe Number<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">define</span> <span style="color: #66cc66;">&#40;</span>find v <span style="color: #b1b100;">l</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">cond</span> <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">null?</span> <span style="color: #b1b100;">l</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>make<span style="color: #66cc66;">-</span>Nothing<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
        <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">=</span> v <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">car</span> <span style="color: #b1b100;">l</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>make<span style="color: #66cc66;">-</span>Just v<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
        <span style="color: #66cc66;">&#91;</span><span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#40;</span>find v <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">cdr</span> <span style="color: #b1b100;">l</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>Though I couldn&#8217;t even deconstruct a value returned by this function &#038; docs are very scarce. And I really doubt the idea, but nevertheless it&#8217;s fun =)</p>
]]></content:encoded>
			<wfw:commentRss>http://jartur.l-square.net/2008/06/plt-scheme-40-is-out/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ICFP PC &#8216;08</title>
		<link>http://jartur.l-square.net/2008/06/icfp-pc-08/</link>
		<comments>http://jartur.l-square.net/2008/06/icfp-pc-08/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 04:19:48 +0000</pubDate>
		<dc:creator>jartur</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jartur.l-square.net/?p=13</guid>
		<description><![CDATA[July 11-14, 2008.
If you want to participate but cannot find a team write/jabber to jartur [at] l-square [dot] net =)
Preferred langs: Scheme, Haskell, Perl.
]]></description>
			<content:encoded><![CDATA[<p>July 11-14, 2008.<br />
If you want to participate but cannot find a team write/jabber to jartur [at] l-square [dot] net =)<br />
Preferred langs: Scheme, Haskell, Perl.</p>
]]></content:encoded>
			<wfw:commentRss>http://jartur.l-square.net/2008/06/icfp-pc-08/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Otitis media is a&#8230;</title>
		<link>http://jartur.l-square.net/2008/06/otitis-media-is-a/</link>
		<comments>http://jartur.l-square.net/2008/06/otitis-media-is-a/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 06:18:26 +0000</pubDate>
		<dc:creator>jartur</dc:creator>
		
		<category><![CDATA[Nothing]]></category>

		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://jartur.l-square.net/?p=12</guid>
		<description><![CDATA[&#8230;very very unpleasant condition.
And also I hate antibiotics.
]]></description>
			<content:encoded><![CDATA[<p>&#8230;very very unpleasant condition.<br />
And also I hate antibiotics.</p>
]]></content:encoded>
			<wfw:commentRss>http://jartur.l-square.net/2008/06/otitis-media-is-a/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Some improvements.</title>
		<link>http://jartur.l-square.net/2008/06/some-improvements/</link>
		<comments>http://jartur.l-square.net/2008/06/some-improvements/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 06:33:36 +0000</pubDate>
		<dc:creator>jartur</dc:creator>
		
		<category><![CDATA[Nothing]]></category>

		<guid isPermaLink="false">http://jartur.l-square.net/?p=11</guid>
		<description><![CDATA[There are some small improvements for commenters on this blog:

You can insert inline latex in your comments using &#x24;&#x24;\latex \code{here}&#x24;&#x24;.
You can insert a latex box in your comments using &#x24;&#x24;!\latex \code{here}&#x24;&#x24;. You should always leave at leas one black line after this box.
You can insert code snippets without syntax highlighting but at least with whitespace [...]]]></description>
			<content:encoded><![CDATA[<p>There are some small improvements for commenters on this blog:</p>
<ul>
<li>You can insert inline latex in your comments using &#x24;&#x24;\latex \code{here}&#x24;&#x24;.</li>
<li>You can insert a latex box in your comments using &#x24;&#x24;!\latex \code{here}&#x24;&#x24;. You should always leave at leas one black line after this box.</li>
<li>You can insert code snippets without syntax highlighting but at least with whitespace preserved using backticks around your code. Always surround it by at least one blank line before and after the code.</li>
</ul>
<p>Examples:</p>
<table>
<tr>
<td><strong>What you type</strong></td>
<td><strong>What you get</strong></td>
<tr>
<td style="border: solid 1px;">Inline latex: &#x24;&#x24;\alpha &gt; \beta&#x24;&#x24;</td>
<td style="border: solid 1px;">Inline latex: <img src="http://jartur.l-square.net/wp-content/cache/tex_be3d99ac4a0a9b7c43253d4838b1615c.png" align="absmiddle" class="tex" alt="\alpha &gt; \beta" /></td>
</tr>
<tr>
<td style="border: solid 1px;">Block latex: &#x24;&#x24;!\frac{\alpha}{\pi}&#x24;&#x24;<br/>
<p>Note the blank line above!</p>
</td>
<td style="border: solid 1px;">Block latex: <center><img src="http://jartur.l-square.net/wp-content/cache/tex_6f61453b29782c8e272325e7ab7f1248.png" align="absmiddle" class="tex" alt="\frac{\alpha}{\pi}" /></center>
<p>Note the blank line above!</p>
</td>
<tr>
<td style="border: solid 1px;">Code follows after a blank line:<br/></p>
<pre>&#x60;x :: a -> a
x a
    | a > 0 = a
    | a < 0 = -a&#x60;</pre>
<p>Note the blank line above.</td>
<td style="border: solid 1px;">Code follows after a blank line:</p>
<div class="backtick"><pre><code>x :: a -&gt; a
x a 
    | a &gt; 0 = a
    | a &lt; 0 = -a</code></pre></div>
<p>Note the blank line above.</td>
</table>
]]></content:encoded>
			<wfw:commentRss>http://jartur.l-square.net/2008/06/some-improvements/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Is Haskell really that&#8230; great as a programming language?</title>
		<link>http://jartur.l-square.net/2008/05/is-haskell-really-that-great-as-a-programming-language/</link>
		<comments>http://jartur.l-square.net/2008/05/is-haskell-really-that-great-as-a-programming-language/#comments</comments>
		<pubDate>Fri, 30 May 2008 08:46:43 +0000</pubDate>
		<dc:creator>jartur</dc:creator>
		
		<category><![CDATA[Haskell]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Thoughts]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[hs]]></category>

		<guid isPermaLink="false">http://jartur.l-square.net/?p=7</guid>
		<description><![CDATA[Reading lots on Haskell recently I&#8217;m beginning to feel like it&#8217;s very cool from the CS point of view, but too overcomplicated from the practical one. And all attempts to prove otherwise, as far as I think of them, have failed.
I mean, you can definitely write a useful Haskell application but isn&#8217;t the cost too [...]]]></description>
			<content:encoded><![CDATA[<p>Reading lots on Haskell recently I&#8217;m beginning to feel like it&#8217;s very cool from the CS point of view, but too overcomplicated from the practical one. And all attempts to prove otherwise, as far as I think of them, have failed.</p>
<p>I mean, you can definitely write a useful Haskell application but isn&#8217;t the cost too high? Isn&#8217;t after all its type system too restrictful? Doesn&#8217;t messing with ErrorT IO seem to be much ado about nothing?</p>
<p>Yes, it&#8217;s cool when you can reason about your programs in almost mathematical sense. It&#8217;s great that you can model the domain with types. It&#8217;s nice to have lazy pure code&#8230; But when you come to side-effects, stateful computation, error handling, &amp;c simultaneously&#8230; Well it starts to feel wrong. Just wrong.</p>
<p>All these are just my thoughts based on short time of learning it. Maybe I&#8217;m just too stupid. Maybe I will have this &#8220;a-ha!&#8221; with Haskell sometime so everything will seem natural to me. But maybe Haskell is just too overcomplicated for actual programming.</p>
<p>It feels like Haskell is actually like maths. Mathematics is all very consistent, you can reason about anything there, you can prove theorems, but when things get complicated they get REALLY complicated. And there is no shortcuts or something like that. And as even tensors don&#8217;t fit in my head really well, Haskell may not too.</p>
<p>Think of it like having a programmer to study algebraic geometry for example. Though Haskell seems to be lots easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://jartur.l-square.net/2008/05/is-haskell-really-that-great-as-a-programming-language/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Simple State monad step-by-step example.</title>
		<link>http://jartur.l-square.net/2008/05/simple-state-monad-step-by-step-example/</link>
		<comments>http://jartur.l-square.net/2008/05/simple-state-monad-step-by-step-example/#comments</comments>
		<pubDate>Thu, 29 May 2008 04:34:25 +0000</pubDate>
		<dc:creator>jartur</dc:creator>
		
		<category><![CDATA[Haskell]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[hs]]></category>

		<guid isPermaLink="false">http://jartur.l-square.net/?p=6</guid>
		<description><![CDATA[To better understand State monad I have derived it step by step from do notation to it&#8217;s constructor form. So to keep the result I post it here.
This is executable Haskell. Save as haskell file &#038; try to run execState tickN 5 for every tickN.

[-]View Code HASKELL1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
module StRed where
import Control.Monad.State
&#160;
{-- Just for reference.
-- &#124; A [...]]]></description>
			<content:encoded><![CDATA[<p>To better understand State monad I have derived it step by step from do notation to it&#8217;s constructor form. So to keep the result I post it here.<br />
This is executable Haskell. Save as haskell file &#038; try to run execState tickN 5 for every tickN.</p>

<div class="wp_codebox_msgheader"><span class="codebox_right"><a href="javascript:;" onclick="toggle_collapse('64');">[<span id="64_symbol">-</span>]</a></span><span class="codebox_left"><span id="l6code4"><a href="javascript:;" onclick="javascript:showCodeTxt('6code4'); return false;">View Code</a> HASKELL</span></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="64"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
</pre></td><td class="code" id="6code4"><pre class="haskell"><span style="color: #06c; font-weight: bold;">module</span> StRed <span style="color: #06c; font-weight: bold;">where</span>
<span style="color: #06c; font-weight: bold;">import</span> Control<span style="color: #66cc66; font-weight: bold;">.</span><span style="color: #cccc00; font-weight: bold;">Monad</span><span style="color: #66cc66; font-weight: bold;">.</span>State
&nbsp;
<span style="color: #5d478b; font-style: italic;">{-- Just for reference.
-- | A parameterizable state monad where /s/ is the type of the state
-- to carry and /a/ is the type of the /return value/.
newtype State s a = State { runState :: s -&gt; (a, s) }
&nbsp;
instance Monad (State s) where
    return a = State $ \s -&gt; (a, s)
    m &gt;&gt;= k  = State $ \s -&gt; let
        (a, s') = runState m s
        in runState (k a) s'
&nbsp;
instance MonadState s (State s) where
    get   = State $ \s -&gt; (s, s)
    put s = State $ \_ -&gt; ((), s)
--}</span>
&nbsp;
<span style="color: #5d478b; font-style: italic;">-- This monad is able to add one to its internal state.</span>
tick <span style="color: #66cc66; font-weight: bold;">::</span> State <span style="color: #cccc00; font-weight: bold;">Int</span> <span style="color: #cccc00; font-weight: bold;">Int</span>
tick <span style="color: #66cc66; font-weight: bold;">=</span> <span style="color: #06c; font-weight: bold;">do</span> n <span style="color: #66cc66; font-weight: bold;">&lt;-</span> get
          put <span style="color: green;">&#40;</span>n<span style="color: red;">+1</span><span style="color: green;">&#41;</span>
          <span style="font-weight: bold;">return</span> n
&nbsp;
<span style="color: #5d478b; font-style: italic;">-- What follows is a derivation of this monad into its normal form.</span>
<span style="color: #5d478b; font-style: italic;">-- Please note, that this derivation doesn't respect Haskell's order of evaluation.</span>
tick1 <span style="color: #66cc66; font-weight: bold;">::</span> State <span style="color: #cccc00; font-weight: bold;">Int</span> <span style="color: #cccc00; font-weight: bold;">Int</span>
tick1 <span style="color: #66cc66; font-weight: bold;">=</span> get <span style="color: #66cc66; font-weight: bold;">&gt;&gt;=</span> <span style="color: green;">&#40;</span>\n <span style="color: #66cc66; font-weight: bold;">-&gt;</span> put <span style="color: green;">&#40;</span>n<span style="color: red;">+1</span><span style="color: green;">&#41;</span> <span style="color: #66cc66; font-weight: bold;">&gt;&gt;=</span> <span style="color: green;">&#40;</span>\<span style="color: #66cc66; font-weight: bold;">_</span> <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="font-weight: bold;">return</span> n<span style="color: green;">&#41;</span><span style="color: green;">&#41;</span>
tick2 <span style="color: #66cc66; font-weight: bold;">=</span> <span style="color: green;">&#40;</span>State <span style="color: green;">&#40;</span>\s <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>s,s<span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span> <span style="color: #66cc66; font-weight: bold;">&gt;&gt;=</span>
              <span style="color: green;">&#40;</span>\n <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>State <span style="color: green;">&#40;</span>\<span style="color: #66cc66; font-weight: bold;">_</span> <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span><span style="color: green;">&#40;</span><span style="color: green;">&#41;</span>, <span style="color: green;">&#40;</span>n<span style="color: red;">+1</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span> <span style="color: #66cc66; font-weight: bold;">&gt;&gt;=</span>
                  <span style="color: green;">&#40;</span>\<span style="color: #66cc66; font-weight: bold;">_</span> <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>State <span style="color: green;">&#40;</span>\p <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>n, p<span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span>
tick3 <span style="color: #66cc66; font-weight: bold;">=</span> <span style="color: green;">&#40;</span>State <span style="color: green;">&#40;</span>\s <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>s,s<span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span> <span style="color: #66cc66; font-weight: bold;">&gt;&gt;=</span>
              <span style="color: green;">&#40;</span>\n <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>State <span style="color: green;">&#40;</span>\q <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: #06c; font-weight: bold;">let</span>
                  <span style="color: green;">&#40;</span>a, q'<span style="color: green;">&#41;</span> <span style="color: #66cc66; font-weight: bold;">=</span> runState <span style="color: green;">&#40;</span>State <span style="color: green;">&#40;</span>\<span style="color: #66cc66; font-weight: bold;">_</span> <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span><span style="color: green;">&#40;</span><span style="color: green;">&#41;</span>, <span style="color: green;">&#40;</span>n<span style="color: red;">+1</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span> q
                  <span style="color: #06c; font-weight: bold;">in</span> runState <span style="color: green;">&#40;</span><span style="color: green;">&#40;</span>\<span style="color: #66cc66; font-weight: bold;">_</span> <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>State <span style="color: green;">&#40;</span>\p <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>n, p<span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span> a<span style="color: green;">&#41;</span> q'<span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span>
tick4 <span style="color: #66cc66; font-weight: bold;">=</span> <span style="color: green;">&#40;</span>State <span style="color: green;">&#40;</span>\s <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>s,s<span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span> <span style="color: #66cc66; font-weight: bold;">&gt;&gt;=</span>
              <span style="color: green;">&#40;</span>\n <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>State <span style="color: green;">&#40;</span>\q <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: #06c; font-weight: bold;">let</span>
                  <span style="color: green;">&#40;</span>a, q'<span style="color: green;">&#41;</span> <span style="color: #66cc66; font-weight: bold;">=</span> <span style="color: green;">&#40;</span><span style="color: green;">&#40;</span><span style="color: green;">&#41;</span>, <span style="color: green;">&#40;</span>n<span style="color: red;">+1</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span>
                  <span style="color: #06c; font-weight: bold;">in</span> <span style="color: green;">&#40;</span>n, q'<span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span>
tick5 <span style="color: #66cc66; font-weight: bold;">=</span> <span style="color: green;">&#40;</span>State <span style="color: green;">&#40;</span>\s <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>s,s<span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span> <span style="color: #66cc66; font-weight: bold;">&gt;&gt;=</span>
              <span style="color: green;">&#40;</span>\n <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>State <span style="color: green;">&#40;</span>\<span style="color: #66cc66; font-weight: bold;">_</span> <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>n, n<span style="color: red;">+1</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span>
tick6 <span style="color: #66cc66; font-weight: bold;">=</span> State <span style="color: green;">&#40;</span>\p <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: #06c; font-weight: bold;">let</span>
              <span style="color: green;">&#40;</span>a, p'<span style="color: green;">&#41;</span> <span style="color: #66cc66; font-weight: bold;">=</span> runState <span style="color: green;">&#40;</span>State <span style="color: green;">&#40;</span>\s <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>s, s<span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span> p
              <span style="color: #06c; font-weight: bold;">in</span> runState <span style="color: green;">&#40;</span><span style="color: green;">&#40;</span>\n <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>State <span style="color: green;">&#40;</span>\<span style="color: #66cc66; font-weight: bold;">_</span> <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>n, n<span style="color: red;">+1</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span> a<span style="color: green;">&#41;</span> p'<span style="color: green;">&#41;</span>
tick7 <span style="color: #66cc66; font-weight: bold;">=</span> State <span style="color: green;">&#40;</span>\p <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: #06c; font-weight: bold;">let</span>
              <span style="color: green;">&#40;</span>a, p'<span style="color: green;">&#41;</span> <span style="color: #66cc66; font-weight: bold;">=</span> <span style="color: green;">&#40;</span>p, p<span style="color: green;">&#41;</span>
              <span style="color: #06c; font-weight: bold;">in</span> <span style="color: green;">&#40;</span>a, a<span style="color: red;">+1</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span>
tick8 <span style="color: #66cc66; font-weight: bold;">=</span> State <span style="color: green;">&#40;</span>\p <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>p, p<span style="color: red;">+1</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span>
&nbsp;
<span style="color: #5d478b; font-style: italic;">-- So, here you are. This monad contains function which returns current state,</span>
<span style="color: #5d478b; font-style: italic;">-- and changes internal state by adding one. Exactly what we supposed.</span>
<span style="color: #5d478b; font-style: italic;">-- Now, when you run it with execState it's easy to see how it works.</span>
a <span style="color: #66cc66; font-weight: bold;">=</span> execState tick8 <span style="color: red;">3</span>
a1 <span style="color: #66cc66; font-weight: bold;">=</span> <span style="font-weight: bold;">snd</span> <span style="color: green;">&#40;</span>runState tick8 <span style="color: red;">3</span><span style="color: green;">&#41;</span>
a2 <span style="color: #66cc66; font-weight: bold;">=</span> <span style="font-weight: bold;">snd</span> <span style="color: green;">&#40;</span><span style="color: green;">&#40;</span>\p <span style="color: #66cc66; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>p, p<span style="color: red;">+1</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span> <span style="color: red;">3</span><span style="color: green;">&#41;</span>
a3 <span style="color: #66cc66; font-weight: bold;">=</span> <span style="font-weight: bold;">snd</span> <span style="color: green;">&#40;</span><span style="color: red;">3</span>, <span style="color: red;">4</span><span style="color: green;">&#41;</span>
a4 <span style="color: #66cc66; font-weight: bold;">=</span> <span style="color: red;">4</span>
&nbsp;
<span style="color: #5d478b; font-style: italic;">-- In fact, I think this monad is easy to write in tick8 form right from the beginning =)</span></pre></td></tr></table></div>

<p>Hope this would help someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://jartur.l-square.net/2008/05/simple-state-monad-step-by-step-example/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CD is a fucking past. Should be extinguished.</title>
		<link>http://jartur.l-square.net/2008/05/cd-is-a-fucking-past-should-be-extinguished/</link>
		<comments>http://jartur.l-square.net/2008/05/cd-is-a-fucking-past-should-be-extinguished/#comments</comments>
		<pubDate>Thu, 08 May 2008 04:50:44 +0000</pubDate>
		<dc:creator>jartur</dc:creator>
		
		<category><![CDATA[Rants]]></category>

		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://jartur.l-square.net/?p=5</guid>
		<description><![CDATA[Inspired somewhat by this post I&#8217;m going to rant a little about CD as an information storage.
1. CD can and should be replaced by files.
CD is not in any way superior to music stored in files. CD is a digital format which stores musical data as a sequence of bits (that is &#8220;0100100100010&#8230;&#8221;) so you [...]]]></description>
			<content:encoded><![CDATA[<p>Inspired somewhat by <a title="The Day the Music Died" href="http://diveintomark.org/archives/2008/05/06/the-day-the-music-died">this</a> post I&#8217;m going to rant a little about CD as an information storage.</p>
<p><strong>1. CD can and should be replaced by files.<br />
</strong>CD is not in any way superior to music stored in files. CD is a digital format which stores musical data as a sequence of bits (that is &#8220;0100100100010&#8230;&#8221;) so you can treat all its contents as just one big file (usually about 650Mb). Music in CD is encoded using <a title="Pulse Code Modulation">PCM</a>, this encoding is used in WAV files on PC. So CD contains just one big WAV file, and some rippers, e.g. <a title="Exact Audio Copy">EAC</a>, treat it just in a right way. When you rip a CD with EAC you get one big file, which contains exactly the same information (bits) as the CD you&#8217;ve ripped.</p>
<p>Now you can compress this file so it would take not so much space on your HDD (or portable player). There are two main options: lossy &amp; lossless compression.</p>
<p>Lossy compression is a kind of compression which throws away some information which is concidered neglegible to achieve very good compressions rates. Examples are: MP3, OGG, AAC. When you compress with lossy codec you get another information and you cannot restore it back to the original. So CD would be always superior to these formats, of course. Especially if you can actually hear the difference between CD and 320Kbps MP3.</p>
<p>Lossless compression, on the other hand, doesn&#8217;t throw away any information when you perform compression. So you get much lower compression rates. But all the information is the same when uncompressed. You can restore it to the original. And that&#8217;s what happens when you play it. Just think of it, when you zip or 7zip or rar your files, they will be exactly the same when you would uncompress them. zip is a lossless compressor. But zip is not good at compressing PCM, it&#8217;s good at textual data, that&#8217;s why there are FLAC, APE &amp; Apple Lossless. (Note that you may get binary different file after decompression of FLAC, this is due to some uncertainty in PCM coding.)</p>
<p>So, lossless compressed files hold exaclty the same information as a CD (except CD text, but who the fuck needs CD text, when you have tags?) plus metadata (tags, yes). And files give you some great bonuses, e.g. easy to copy, easy to change tracks and albums (you don&#8217;t have to have a CD changer to listen to 40 track from different albums), easy to create playlists, they don&#8217;t expire (ever scratched your CD hard?), and on.</p>
<p>Btw, if we talk about CD/DVD as a holder of non-musical data, files are better too when you need the data often (for backups DVD is just good). Have you ever bought a StarForce protected game and then made a little scratch on a CD so your game wouldn&#8217;t load? Well, try to refund it, good luck.</p>
<p><strong>2. CD is lossy.<br />
</strong>There are some lossless formats which are superior to CD in terms of information storing, they are analog. There are also other lossy formats which are superior to CD but still digital (e.g. digital master recording, 24/96Khz FLAC, and so on).</p>
<p>The only losless formats for storing musical data are analog: vinyl (sure there is noise there, but that&#8217;s off-the point), tape (e.g. master tapes, which are used in studios) and the best is the live performance (the only truly lossy one, I suppose). So if you are kind of audiophile, you&#8217;d better listen to these. Vinyl is a great choise. And actually you may rip vinyl or tape into a lossy-better-than-CD (e.g. 24/96Khz) format if you have a decent audiocard and some other high-end equipment.</p>
<p><strong>3. SACD and DVDAudio are not the options.<br />
</strong>SACD is just the same as CD but with higher definition. The same goes for DVDAudio. And more to this: these formats are so fucking DRM&#8217;ed I will never ever use them. I would rather buy vinyl and rip it to FLAC with the same definition as SACD. Btw, analog cannot be DRM&#8217;ed ;)</p>
<p>So, that&#8217;s all for today.</p>
]]></content:encoded>
			<wfw:commentRss>http://jartur.l-square.net/2008/05/cd-is-a-fucking-past-should-be-extinguished/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Haskell is good. Is it?</title>
		<link>http://jartur.l-square.net/2008/05/haskell-is-good-is-it/</link>
		<comments>http://jartur.l-square.net/2008/05/haskell-is-good-is-it/#comments</comments>
		<pubDate>Thu, 08 May 2008 04:06:51 +0000</pubDate>
		<dc:creator>jartur</dc:creator>
		
		<category><![CDATA[Haskell]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[hs]]></category>

		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://jartur.l-square.net/?p=4</guid>
		<description><![CDATA[Working through a few tutorials and books on Haskell I think I&#8217;m starting to feel that it&#8217;s all very good until it comes to Stateful Fucking Computations.
Well, I know that I do not know Haskell. And I know that I cannot wrap may head around all of its concepts right now (Monad Transformers? Arrows for [...]]]></description>
			<content:encoded><![CDATA[<p>Working through a few tutorials and books on Haskell I think I&#8217;m starting to feel that it&#8217;s all very good until it comes to Stateful Fucking Computations.</p>
<p>Well, I know that I do not know Haskell. And I know that I cannot wrap may head around all of its concepts right now (Monad Transformers? Arrows for god&#8217;s sake?). But on the other hand I see how it becomes, well, almost explosionary more compilcated as you start adding Stateful Fucking Stuff. Monad + Monad + Monad Transformer + Another one&#8230; And if you just have missed somehow that you will need, e.g. ST + IO + Error, and have just implemented smth without Error&#8230; Well welcome to ErrorT rewriting of great bunch of you functions. And it doesn&#8217;t seem to be always easy.</p>
<p>And of course I still have troubles with types. X :: A b c d WTF? Don&#8217;t yet clearly understand the difference between type, newtype &amp; data. Well data is for algebraic datatypes. But type and newtype do somewhat confuse me.</p>
<p>And actually, writing an interpreter seems to be much harder (Parsec, State, IO through most of the program, Error throwing anywhere) than writing a compiler (Parsec -&gt; Tree, work on the tree in a purely functional manner, generate code in a purely functional matter, you will only have to handle errors somehow in a good way. But I think it&#8217;s not that hard to do this w/o using monads here, actually. And IO only for Input once &amp; Output once, all in main :: IO ()).</p>
<p>Frankly, Scheme seems to be MUCH easier to grasp. But after all, that&#8217;s one of the points why I actually did start to grok Haskell.</p>
<p>Good luck me.</p>
]]></content:encoded>
			<wfw:commentRss>http://jartur.l-square.net/2008/05/haskell-is-good-is-it/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
