<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>OJ's rants &#187; F#</title>
	<atom:link href="http://buffered.io/category/f/feed/" rel="self" type="application/rss+xml" />
	<link>http://buffered.io</link>
	<description>What would OJ do?</description>
	<lastBuildDate>Tue, 06 Jul 2010 20:32:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Validating use of Parenthesis</title>
		<link>http://buffered.io/2008/07/24/validating-use-of-parenthesis/</link>
		<comments>http://buffered.io/2008/07/24/validating-use-of-parenthesis/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 23:11:18 +0000</pubDate>
		<dc:creator>OJ</dc:creator>
				<category><![CDATA[Challenges]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[challenge]]></category>
		<category><![CDATA[fsharp]]></category>
		<category><![CDATA[functional]]></category>

		<guid isPermaLink="false">http://buffered.io/?p=394</guid>
		<description><![CDATA[Yet another programming challenge appeared on dev102 the other day, and I thought that this time I'd post my solution here in the blog rather than letting it get lost in the depths of the comment thread! The problem is as follows: Your input is a string which is composed from bracket characters. The allowed [...]]]></description>
			<content:encoded><![CDATA[<p>Yet another <a href="http://www.dev102.com/2008/07/21/a-programming-job-interview-challenge-13-brackets/" title="Programming Challenge">programming challenge appeared on dev102</a> the other day, and I thought that this time I'd post my solution here in the blog rather than letting it get lost in the depths of the comment thread! </p>
<p>The problem is as follows:<br />
<blockquote>
<p>Your input is a string which is composed from bracket characters. The allowed characters are:’(', ‘)’, ‘[', ']‘, ‘{’, ‘}’, ‘&lt;’ and ‘&gt;’. Your mission is to determine whether the brackets structure is legal or not.</p>
<p>Example of a legal expression: “([](&lt;{}&gt;))”.</p>
<p>Example of an illegal expression: “({&lt;)&gt;}”.</p>
</blockquote>
<p>Is what I'm about to show the most efficient? No. Is it the most elegant? Hell no! But it works <img src='http://buffered.io/wp-content/plugins/smilies-themer/Silk/emoticon_smile.png' alt=':)' class='wp-smiley' /> </p>
<p>It's surprisingly similar to <a href="http://www.fsharp.it/2008/07/22/balanced-parenthesis/" title="Balanced Parenthesis">this solution</a> over at Fsharp.it. It is different in that it allows non-bracket characters to be entered into the string as well.</p>

<div class="wp_syntax"><div class="code"><pre class="fsharp" style="font-family:monospace;">#light
&nbsp;
let parens = [| ('(',')');('[',']');('{','}');('&lt;','&gt;') |]
let isOpen l = Array.exists (fun(o,c) -&gt; o = l) parens
let isClose l = Array.exists (fun(o,c) -&gt; c = l) parens
let isPair p = Array.exists (fun l -&gt; p = l) parens
&nbsp;
let validate inp =
  let rec v' str stack =
    match str with
    | [] -&gt; stack = []
    | c :: cs when isOpen c -&gt; v' cs (c :: stack)
    | c :: cs when isClose c -&gt;
        if isPair ((List.hd stack), c)
            then v' cs (List.tl stack)
            else false
    | c :: cs -&gt; v' cs stack
  v' (List.of_seq inp) []</pre></div></div>

<p>Call the function like so:</p>

<div class="wp_syntax"><div class="code"><pre class="fsharp" style="font-family:monospace;">validate &quot;thisIsAFunction(int[] foo, delegate{}, bar()); // &lt; testing &gt;&quot;</pre></div></div>

<p>In short, the function uses an internal "stack" (which is actually a list) to keep track of open brackets. When a closed bracket is found, it's validated against the open bracket at the top of the stack.</p>
<p>Fairly simple stuff. There are optimisations that can be made around the searching for items in the <em>parens</em> array, but I couldn't be bothered changing it <img src='http://buffered.io/wp-content/plugins/smilies-themer/Silk/emoticon_smile.png' alt=':)' class='wp-smiley' /> For me at the moment it's more about playing with F#.</p>
<p>Thoughts?</p>
]]></content:encoded>
			<wfw:commentRss>http://buffered.io/2008/07/24/validating-use-of-parenthesis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>An Interesting Little Problem</title>
		<link>http://buffered.io/2008/06/14/an-interesting-little-problem/</link>
		<comments>http://buffered.io/2008/06/14/an-interesting-little-problem/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 10:39:38 +0000</pubDate>
		<dc:creator>OJ</dc:creator>
				<category><![CDATA[Challenges]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[challenge]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://buffered.io/?p=365</guid>
		<description><![CDATA[This post was inspired by a recent interview question that was posted over at fsharp.it. It's one of those neat little questions which looks really simple on the surface but is quite tricky. The question apparently originates from an interview that someone had with Google, and goes something like this: There is an array A[N] [...]]]></description>
			<content:encoded><![CDATA[<p>This post was inspired by a recent interview question that was posted over at <a href="http://www.fsharp.it/2008/06/10/google-interview-question-product-of-other-elements-in-an-array-in-on/" title="Fsharp.it">fsharp.it</a>. It's one of those neat little questions which looks really simple on the surface but is quite tricky. </p>
<p>The question apparently originates from an interview that someone had with Google, and goes something like this:<br />
<blockquote>
<p>
There is an array A[N] of N integers. You have to compose an array Output[N] such that Output[i] will be equal to the product of all the elements of A[] except A[i].</p>
<p>Example:<br />
&nbsp;&nbsp;&nbsp;&nbsp;INPUT:[4, 3, 2, 1, 2]<br />
&nbsp;&nbsp;&nbsp;&nbsp;OUTPUT:[12, 16, 24, 48, 24]</p>
<p><strong>Note:</strong> Solve it <em>without</em> the division operator and in O(n).
</p>
</blockquote>
<p>Since I had a spare 10 minutes, I decided to give it a shot ... in Haskell.</p>
<p>I'll cut to the chase, here's the source to my solution:</p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;">vals <span style="color: #339933; font-weight: bold;">::</span> <span style="color: green;">&#91;</span><span style="color: #cccc00; font-weight: bold;">Int</span><span style="color: green;">&#93;</span>
vals <span style="color: #339933; font-weight: bold;">=</span> <span style="color: green;">&#91;</span> <span style="color: red;">4</span><span style="color: #339933; font-weight: bold;">,</span> <span style="color: red;">3</span><span style="color: #339933; font-weight: bold;">,</span> <span style="color: red;">2</span><span style="color: #339933; font-weight: bold;">,</span> <span style="color: red;">1</span><span style="color: #339933; font-weight: bold;">,</span> <span style="color: red;">2</span> <span style="color: green;">&#93;</span>
&nbsp;
answers <span style="color: #339933; font-weight: bold;">::</span> <span style="color: green;">&#91;</span><span style="color: #cccc00; font-weight: bold;">Int</span><span style="color: green;">&#93;</span>
answers <span style="color: #339933; font-weight: bold;">=</span> <span style="color: green;">&#91;</span> front <span style="color: #339933; font-weight: bold;">!!</span> <span style="color: green;">&#40;</span>x<span style="color: #339933; font-weight: bold;">-</span><span style="color: red;">1</span><span style="color: green;">&#41;</span> <span style="color: #339933; font-weight: bold;">*</span> back <span style="color: #339933; font-weight: bold;">!!</span> <span style="color: green;">&#40;</span>x<span style="color: #339933; font-weight: bold;">+</span><span style="color: red;">1</span><span style="color: green;">&#41;</span> <span style="color: #339933; font-weight: bold;">|</span> x <span style="color: #339933; font-weight: bold;">&lt;-</span> <span style="color: green;">&#91;</span>1<span style="color: #339933; font-weight: bold;">..</span><span style="font-weight: bold;">length</span> vals<span style="color: green;">&#93;</span> <span style="color: green;">&#93;</span>
  <span style="color: #06c; font-weight: bold;">where</span>
    front <span style="color: #339933; font-weight: bold;">=</span> <span style="font-weight: bold;">scanl1</span> <span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">*</span><span style="color: green;">&#41;</span> temp
    back <span style="color: #339933; font-weight: bold;">=</span> <span style="font-weight: bold;">scanr1</span> <span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">*</span><span style="color: green;">&#41;</span> temp
    temp <span style="color: #339933; font-weight: bold;">=</span> <span style="color: green;">&#91;</span><span style="color: red;">1</span><span style="color: green;">&#93;</span> <span style="color: #339933; font-weight: bold;">++</span> vals <span style="color: #339933; font-weight: bold;">++</span> <span style="color: green;">&#91;</span><span style="color: red;">1</span><span style="color: green;">&#93;</span></pre></div></div>

<p>I'm hoping that this is quite self-explanatory. But in case it's not, I'll cover some of the gory bits.</p>
<p>The core of the problem is coming up with a way of determining the value of the product of numbers from the start of the list up to a given index, and to do the same at the other end of the list from that given index.</p>
<p>I thought that the easiest way would be to create two lists: both of them containing the compounded products of the numbers in the list, but each of them in different directions. To generate those lists, I thought that I'd add the value of 1 to the list, both at the start and at the end, as it would allow me to do two things:
<ol>
<li>Generate the lists using the <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v%3Ascanl1" title="scanl1">scanl1</a> and scanr1 functions.</li>
<li>Index into the list using a counter that's based on the size of the original values without having to worry about going past the bounds of the list.</li>
</ol>
<p>Yup, quite lazy, but very handy.</p>
<p>Here's the output when I execute <em>answers</em> in <a href="http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci.html" title="GHCi">GHCi</a>:</p>
<pre lang="">Prelude> :l google.hs
[1 of 1] Compiling Main             ( google.hs, interpreted )
Ok, modules loaded: Main.
*Main> answers
[12,16,24,48,24]
*Main>
</pre>
<p>Problem solved in O(n). Neato! After feeling rather chuffed with myself I thought I'd go back to Fsharp.it and check out the answer posted there. The principle was similar, but the implementation listed was a little longer.</p>
<p>So I thought I'd have a go at writing up my solution using F#. It didn't seem like a stretch until I realised how little of the language I know (I'm currently reading through <a href="http://www.amazon.com/Expert-F-Experts-Voice-Net/dp/1590598504" title="Expert F#">Expert F#</a>, but I'm still far from being one myself). Here's what I came up with:</p>

<div class="wp_syntax"><div class="code"><pre class="ocaml" style="font-family:monospace;"><span style="color: #a52a2a;">#</span>light
&nbsp;
<span style="color: #06c; font-weight: bold;">let</span> vals <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span> <span style="color: #c6c;">4</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">3</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">2</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">1</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">2</span><span style="color: #a52a2a;">;</span> <span style="color: #6c6;">&#93;</span>
&nbsp;
<span style="color: #06c; font-weight: bold;">let</span> mul a b <span style="color: #a52a2a;">=</span> a <span style="color: #a52a2a;">*</span> b
<span style="color: #06c; font-weight: bold;">let</span> <span style="color: #6c6;">&#40;</span><span style="color: #a52a2a;">++</span><span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span> <span style="color: #06c; font-weight: bold;">List</span><span style="color: #a52a2a;">.</span><span style="color: #060;">append</span>
&nbsp;
<span style="color: #06c; font-weight: bold;">let</span> answers <span style="color: #a52a2a;">=</span>
  <span style="color: #06c; font-weight: bold;">let</span> temp <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">1</span><span style="color: #6c6;">&#93;</span> <span style="color: #a52a2a;">++</span> vals <span style="color: #a52a2a;">++</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">1</span><span style="color: #6c6;">&#93;</span>
  <span style="color: #06c; font-weight: bold;">let</span> front <span style="color: #a52a2a;">=</span> <span style="color: #06c; font-weight: bold;">List</span><span style="color: #a52a2a;">.</span><span style="color: #060;">scan1_left</span> mul temp <span style="color: #a52a2a;">|&gt;</span> <span style="color: #06c; font-weight: bold;">List</span><span style="color: #a52a2a;">.</span><span style="color: #060;">to_array</span>
  <span style="color: #06c; font-weight: bold;">let</span> back <span style="color: #a52a2a;">=</span> <span style="color: #06c; font-weight: bold;">List</span><span style="color: #a52a2a;">.</span><span style="color: #060;">scan1_right</span> mul temp <span style="color: #a52a2a;">|&gt;</span> <span style="color: #06c; font-weight: bold;">List</span><span style="color: #a52a2a;">.</span><span style="color: #060;">to_array</span>
  seq <span style="color: #6c6;">&#123;</span> <span style="color: #06c; font-weight: bold;">for</span> x <span style="color: #06c; font-weight: bold;">in</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">1</span> <span style="color: #a52a2a;">..</span> <span style="color: #060;">vals</span><span style="color: #a52a2a;">.</span><span style="color: #060;">Length</span><span style="color: #6c6;">&#93;</span> <span style="color: #a52a2a;">-&gt;</span> front<span style="color: #a52a2a;">.</span><span style="color: #6c6;">&#91;</span>x<span style="color: #a52a2a;">-</span><span style="color: #c6c;">1</span><span style="color: #6c6;">&#93;</span> <span style="color: #a52a2a;">*</span> back<span style="color: #a52a2a;">.</span><span style="color: #6c6;">&#91;</span>x<span style="color: #a52a2a;">+</span><span style="color: #c6c;">1</span><span style="color: #6c6;">&#93;</span> <span style="color: #6c6;">&#125;</span></pre></div></div>

<p>A few things you might notice:
<ol>
<li>My syntax highlighter plugin doesn't currently support F# <img src='http://buffered.io/wp-content/plugins/smilies-themer/Silk/emoticon_smile.png' alt=':)' class='wp-smiley' /> </li>
<li>I use a similar method to the Haskell solution, but ended up having to convert the <em>front</em> and <em>back</em> lists to arrays. The reason was because I need to be able to index into the resulting integer set, and I can't do that with lists (if I'm wrong, please let me know!)</li>
<li>I defined a function called <em>mul</em> which does a simple multiplication. I wanted to pass <em>(*)</em> as the first parameter to the scan1_* functions, but the interpreter took that as the start of a comment instead! So I had to resort to a dodgey hack. If you know a way around this, please let me know.</li>
<li>I wrote my own (++) operator because I didn't want to have to write List.append more than once <img src='http://buffered.io/wp-content/plugins/smilies-themer/Silk/emoticon_smile.png' alt=':)' class='wp-smiley' /> </li>
</ol>
<p>In other words, my F# version smells like n00b. I'm sure there are so many better ways to implement this using the built-in features of the language and supporting libraries, but I'm yet to get to the level when I can write it. I'd love for someone to show me how <img src='http://buffered.io/wp-content/plugins/smilies-themer/Silk/emoticon_smile.png' alt=':)' class='wp-smiley' /> </p>
<p>I did enjoy having a dabble with F# for the first time in ages, though I have to admit I much prefer using <a href="http://www.vim.org/" title="VIM">VIM</a> and <a href="http://research.microsoft.com/fsharp/manual/compiler.aspx" title="F# Interactive">fsi.exe</a> instead of <a href="http://msdn.microsoft.com/en-us/vstudio/default.aspx" title="Visual Studio">Visual Studio</a> and the <a href="http://blogs.msdn.com/dsyme/archive/2006/02/19/534925.aspx" title="A Taste of F# Interactive in Visual Studio">interactive F# add-in</a>.</p>
<p>As always, feedback and criticism welcomed (and needed).</p>
<h2>Update</h2>
<p>After some great feedback (see below), I've come to realise that the !! operator in Haskell is actually O(n) itself. Hence it was a bad choice for inclusion. Back to the drawing board for me!</p>
<p>Here are a couple of submitted Haskell solutions.</p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;"><span style="color: #5d478b; font-style: italic;">-- by lf</span>
scanm f z xs <span style="color: #339933; font-weight: bold;">=</span> <span style="font-weight: bold;">zipWith</span> f <span style="color: green;">&#40;</span><span style="font-weight: bold;">scanl</span> f z xs<span style="color: green;">&#41;</span> <span style="color: green;">&#40;</span><span style="font-weight: bold;">tail</span> <span style="color: #339933; font-weight: bold;">$</span> <span style="font-weight: bold;">scanr</span> f z xs<span style="color: green;">&#41;</span>
main <span style="color: #339933; font-weight: bold;">=</span> <span style="font-weight: bold;">print</span> <span style="color: #339933; font-weight: bold;">$</span> scanm <span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">*</span><span style="color: green;">&#41;</span> <span style="color: red;">1</span> <span style="color: green;">&#91;</span><span style="color: red;">4</span><span style="color: #339933; font-weight: bold;">,</span><span style="color: red;">3</span><span style="color: #339933; font-weight: bold;">,</span><span style="color: red;">2</span><span style="color: #339933; font-weight: bold;">,</span><span style="color: red;">1</span><span style="color: #339933; font-weight: bold;">,</span><span style="color: red;">2</span><span style="color: green;">&#93;</span>
&nbsp;
<span style="color: #5d478b; font-style: italic;">-- by Henning</span>
answers <span style="color: #339933; font-weight: bold;">::</span> <span style="color: green;">&#91;</span><span style="color: #cccc00; font-weight: bold;">Int</span><span style="color: green;">&#93;</span> <span style="color: #339933; font-weight: bold;">-&gt;</span> <span style="color: green;">&#91;</span><span style="color: #cccc00; font-weight: bold;">Int</span><span style="color: green;">&#93;</span>
answers vals <span style="color: #339933; font-weight: bold;">=</span> <span style="font-weight: bold;">zipWith</span> <span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">*</span><span style="color: green;">&#41;</span> front <span style="color: green;">&#40;</span><span style="font-weight: bold;">drop</span> <span style="color: red;">1</span> back<span style="color: green;">&#41;</span>
	<span style="color: #06c; font-weight: bold;">where</span>
	front <span style="color: #339933; font-weight: bold;">=</span> <span style="font-weight: bold;">scanl</span> <span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">*</span><span style="color: green;">&#41;</span> <span style="color: red;">1</span> vals
	back <span style="color: #339933; font-weight: bold;">=</span> <span style="font-weight: bold;">scanr</span> <span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">*</span><span style="color: green;">&#41;</span> <span style="color: red;">1</span> vals
&nbsp;
<span style="color: #5d478b; font-style: italic;">-- by desp</span>
problem input <span style="color: #339933; font-weight: bold;">=</span> <span style="font-weight: bold;">zipWith</span> <span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">*</span><span style="color: green;">&#41;</span> front back <span style="color: #06c; font-weight: bold;">where</span>
  front <span style="color: #339933; font-weight: bold;">=</span> <span style="font-weight: bold;">init</span> <span style="color: green;">&#40;</span><span style="font-weight: bold;">scanl</span> <span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">*</span><span style="color: green;">&#41;</span> <span style="color: red;">1</span> input<span style="color: green;">&#41;</span>
  back <span style="color: #339933; font-weight: bold;">=</span> <span style="font-weight: bold;">tail</span> <span style="color: green;">&#40;</span><span style="font-weight: bold;">scanr</span> <span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">*</span><span style="color: green;">&#41;</span> <span style="color: red;">1</span> input<span style="color: green;">&#41;</span>
&nbsp;
<span style="color: #5d478b; font-style: italic;">-- by foobar</span>
foo <span style="color: green;">&#91;</span><span style="color: green;">&#93;</span> <span style="color: #339933; font-weight: bold;">_</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="color: green;">&#40;</span><span style="color: green;">&#91;</span><span style="color: green;">&#93;</span><span style="color: #339933; font-weight: bold;">,</span> <span style="color: red;">1</span><span style="color: green;">&#41;</span>
foo <span style="color: green;">&#40;</span>x:xs<span style="color: green;">&#41;</span> acc <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #06c; font-weight: bold;">let</span> <span style="color: green;">&#40;</span>l<span style="color: #339933; font-weight: bold;">,</span> m<span style="color: green;">&#41;</span> <span style="color: #339933; font-weight: bold;">=</span> foo xs <span style="color: green;">&#40;</span>acc<span style="color: #339933; font-weight: bold;">*</span>x<span style="color: green;">&#41;</span>
                 <span style="color: #06c; font-weight: bold;">in</span> <span style="color: green;">&#40;</span><span style="color: green;">&#40;</span>m<span style="color: #339933; font-weight: bold;">*</span>acc<span style="color: green;">&#41;</span>:l <span style="color: #339933; font-weight: bold;">,</span> m<span style="color: #339933; font-weight: bold;">*</span>x<span style="color: green;">&#41;</span></pre></div></div>

<p>Thanks for the submissions guys <img src='http://buffered.io/wp-content/plugins/smilies-themer/Silk/emoticon_smile.png' alt=':)' class='wp-smiley' /> Sorry for not including the imperative versions in the update.</p>
]]></content:encoded>
			<wfw:commentRss>http://buffered.io/2008/06/14/an-interesting-little-problem/feed/</wfw:commentRss>
		<slash:comments>68</slash:comments>
		</item>
		<item>
		<title>F# Presentation Tomorrow</title>
		<link>http://buffered.io/2008/03/17/f-presentation-tomorrow/</link>
		<comments>http://buffered.io/2008/03/17/f-presentation-tomorrow/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 07:15:05 +0000</pubDate>
		<dc:creator>OJ</dc:creator>
				<category><![CDATA[F#]]></category>

		<guid isPermaLink="false">http://buffered.io/2008/03/17/f-presentation-tomorrow/</guid>
		<description><![CDATA[It seems that the Gods have finally smiled upon me. They have answered my request to work with smart people! I am currently fortunate enough to be working with a few Guns who are well-known in the industry. Rather than mention all of them, I'm just going to focus on one who for now happens [...]]]></description>
			<content:encoded><![CDATA[<p>It seems that the Gods have finally smiled upon me. They have answered my request to work with smart people! I am currently fortunate enough to be working with a few Guns who are well-known in the industry. Rather than mention all of them, I'm just going to focus on one who for now happens to be in line with my current "theme" of <a href="http://en.wikipedia.org/wiki/Functional_programming" title="Functional programming">functional programming</a> posts. </p>
<p>The well-respected <a href="http://www.secretgeek.net/" title="secretGeek">secretGeek</a>, also known as <a href="http://www.secretgeek.net/about.asp" title="About 'secretGeek'">Leon Bambrick</a>, is going to be giving an <a href="http://www.secretgeek.net/fsharp_eye.asp" title="F# eye for the C# guy">introductory talk</a> on the <a href="" title="F#">F# language</a> tomorrow night, Tuesday 18th March at 6pm. If you're keen to go, best check out the link and register your interest. It'll no doubt be a great presentation by someone who's not only smart but a bloody nice chap to boot.</p>
<p>If you have time, make sure you tag along. You won't regret it! I might even see you there if I can shake this damned cold!</p>
]]></content:encoded>
			<wfw:commentRss>http://buffered.io/2008/03/17/f-presentation-tomorrow/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Current Geek Interests</title>
		<link>http://buffered.io/2008/03/17/current-geek-interests/</link>
		<comments>http://buffered.io/2008/03/17/current-geek-interests/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 03:43:35 +0000</pubDate>
		<dc:creator>OJ</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://buffered.io/2008/03/17/current-geek-interests/</guid>
		<description><![CDATA[As the weeks roll by I'm finding that I have less and less time to chase up anything geek-related. I'm sure I'm not alone Responsibilities and life take over and that time which you could invest is now invested in other things, such as children I'm dedicating this post to all those things that I [...]]]></description>
			<content:encoded><![CDATA[<p>As the weeks roll by I'm finding that I have less and less time to chase up anything geek-related. I'm sure I'm not alone <img src='http://buffered.io/wp-content/plugins/smilies-themer/Silk/emoticon_wink.png' alt=';)' class='wp-smiley' /> Responsibilities and life take over and that time which you <em>could</em> invest is now invested in other things, such as <a href="http://buffered.io/2008/02/14/my-boy/" title="My Boy">children</a> <img src='http://buffered.io/wp-content/plugins/smilies-themer/Silk/emoticon_smile.png' alt=':)' class='wp-smiley' /> </p>
<p>I'm dedicating this post to all those things that I currently find interesting and would love to invest time in. Some of these things are old, some new. All of them I've either not touched on at all, or have touched on only briefly (not enough to be satisfied). I thought I'd share them with you in case you find them interesting yourself, or perhaps have some insights which you'd like to share. </p>
<h2>Haskell</h2>
<p><a href="http://www.haskell.org/" title="Haskell">Haskell</a> is a fairly well-known functional programming language that's been around for quite some time. It's extremely powerful, and it is a lot of fun to work with. I'm certainly no expert in Haskell-land, but so far I've been able to do some fairly nifty stuff. I've been ploughing through the <a href="http://projecteuler.net/" title="Project Euler">Project Euler</a> challenges using Haskell and I've been amazed at how concise the solutions can be. I have a lot more to learn, and I'm hoping that I'll get the chance to do just that. If you haven't played with a pure functional language before then give this one a spin. There are a selection of compilers out there, I personally use <a href="http://www.haskell.org/ghc/" title="Glasgow Haskell Compiler">GHC</a>.</p>
<h2>F#</h2>
<p><a href="http://research.microsoft.com/fsharp/fsharp.aspx" title="F#">F#</a> is a relatively new functional language that runs on the <a href="http://en.wikipedia.org/wiki/.NET_Framework" title=".NET framework">.NET platform</a>. It was created (I believe) by a chap called <a href="http://blogs.msdn.com/dsyme/" title="Don Syme's Weblog">Don Syme</a> and is gaining momentum amongst the geek community. It looks like a lot of fun and is apparently extremely powerful. If it's anything like Haskell, then I'm sure I'll love fiddling with it ... especially when it's got the backing of the .NET framework to leverage from. For your info, I stumbled on <a href="http://msdn2.microsoft.com/en-us/magazine/cc164244.aspx?pr=blog" title="F#: Use Functional Programming Techniques in the .NET Framework">this little doozy</a> which is quite an interesting read.</p>
<h2>ASP.NET MVC</h2>
<p>I've dabbled with <a href="http://rubyonrails.org/" title="Ruby on Rails">Ruby on Rails</a> in the past, and while I liked it I wasn't "blown away" by it like so many other people. The <a href="http://www.ruby-lang.org/" title="Ruby Programming Language">Ruby</a> language is a nice one to work with, but I feel that the interpreter needs a bit more work before I could consider it a serious choice for my needs. On top of that, Rails isn't exactly blisteringly fast. So when the <a href="http://www.asp.net/mvc/" title="ASP.NET MVC">ASP.NET MVC</a> appeared I was excited at the chance to toy with something that would fit a similar mould to Rails (as far as structure is concerned) but based on .NET (allowing me to toy with a few different languages). I've been a ASP.NET WebForms dev for many years now, and I never really liked the Page Model. I believe that the MVC framework is a really good step in the right direction, and I hope that when the time comes, Microsoft decides to cull the old Page Model and push ahead with the MVC as the main ASP.NET development framework. I think that this is going to be "the way of the future" as far as web development is concerned, so it's definitely worth taking for a spin. There are stacks of resources out there to help learn, so if you've got time and have an interest in this sort of thing then check it out.</p>
<h2>WPF</h2>
<p>The latest fad from Microsoft in the rich-client area is <a href="http://msdn2.microsoft.com/en-us/netframework/aa663326.aspx" title="Windows Presentation Foundation">WPF (Windows Presentation Foundation)</a>. I've always been an advocate for rich-client applications over web applications. Being a game dev geek and a fan of graphics with rich user interfaces, I'm always interested to play with new libraries and technologies that make it easier to develop such applications. It looks like a great technology that really does make <a href="http://en.wikipedia.org/wiki/Windows_Forms" title="Windows Forms">WinForms</a> look primitive. It's a worthy option if you're going to do some rich client dev.</p>
<h2>Silverlight</h2>
<p>Is it a killer for Flash? Who knows, but it's a worthy contender. <a href="http://silverlight.net/" title="Silverlight">Silverlight</a> is essentially a direct competitor of Adobe's <a href="http://www.adobe.com/products/flash/about/" title="Flash">Flash</a> product. It runs on the .NET platform (again) and is a subset of WPF (I believe, correct me if I'm wrong). It looks to be a viable way of getting rich interaction over the web.</p>
<h2>Flash</h2>
<p>As mentioned already, <a href="http://www.adobe.com/products/flash/about/" title="Flash">Flash</a> is Adobe's product which delivers rich experiences over the web (they acquired it when they bought Macromedia). It's a cross-platform doohicky and runs on <a href="http://www.actionscript.com/" title="ActionScript">ActionScript</a>. It's been around for a long time and has a huge established user-base. I have also heard rumblings that Adobe are going to be releasing a tool which allows you to write code in other languages (such as C++) and convert it to ActionScript for use in Flash. Pretty nifty really! I think it's a good move if they hope to stay in the game now that Sliverlight is a player.</p>
<h2>Merb</h2>
<p><a href="http://merbivore.com/" title="Merb">Merb</a> is a Ruby MVC development framework which is a viable alternative to Rails. If you're happy to ignore the performance issues of Ruby and feel the need to build a web application with it, I'd recommend checking out Merb. I've heard some really good things about it.</p>
<p>They're my current areas of interest. Feel free to post with stuff that's sparking your interest! Cheers.</p>
]]></content:encoded>
			<wfw:commentRss>http://buffered.io/2008/03/17/current-geek-interests/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
