<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Head in the Clouds</title>
	<atom:link href="http://iand675.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://iand675.wordpress.com</link>
	<description>Thoughts From 30000 Feet. Life, God, and Programming</description>
	<lastBuildDate>Wed, 28 Oct 2009 23:11:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='iand675.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Head in the Clouds</title>
		<link>http://iand675.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://iand675.wordpress.com/osd.xml" title="Head in the Clouds" />
	<atom:link rel='hub' href='http://iand675.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Benchmark Suites in Ruby</title>
		<link>http://iand675.wordpress.com/2009/10/28/benchmark-suites-in-ruby/</link>
		<comments>http://iand675.wordpress.com/2009/10/28/benchmark-suites-in-ruby/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 23:11:41 +0000</pubDate>
		<dc:creator>iand675</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iand675.wordpress.com/?p=14</guid>
		<description><![CDATA[I&#8217;ve been learning a bit of Ruby because I&#8217;m putting together a web startup that I&#8217;d like to build using Rails, so for a recent CS assignment requiring us to benchmark array performance, I decided I&#8217;d make use of Ruby&#8217;s built in benchmarking libraries. Unfortunately, since Ruby doesn&#8217;t have higher order functions as I&#8217;m used [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iand675.wordpress.com&amp;blog=9393007&amp;post=14&amp;subd=iand675&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been learning a bit of Ruby because I&#8217;m putting together a web startup that I&#8217;d like to build using Rails, so for a recent CS assignment requiring us to benchmark array performance, I decided I&#8217;d make use of Ruby&#8217;s built in benchmarking libraries. Unfortunately, since Ruby doesn&#8217;t have higher order functions as I&#8217;m used to using in Haskell, I needed to come up with a way to pass in an array of functions to a helper benchmarking function. Enter eval:</p>
<p>eval allows arbitrary strings to be treated as code, so here&#8217;s what I came up with:</p>
<p><pre class="brush: ruby;">
def bm_help(l)
  mags = [100, 1000, 10000, 100000, 1000000]
  mags.each do |order|
    puts &quot;\nBENCHMARKING ARRAYS OF SIZE &quot; + order.to_s
    testFwd = (1..order).to_a
    testRev = testFwd.reverse
    testRnd = testFwd.shuffle

    l.each do |name|
      puts (&quot;\n&quot; + name)
      Benchmark.bm(8) do |x|
        x.report(&quot;random: &quot;) do
          eval (&quot;testRnd.&quot; + name)
        end
        x.report(&quot;reverse: &quot;) do
          eval (&quot;testRev.&quot; + name)
        end
        x.report(&quot;inorder: &quot;) do
          eval (&quot;testFwd.&quot; + name)
        end
      end
    end
  end
end

bm_help [&quot;quicksort&quot;, &quot;shellsort&quot;, &quot;mergesort&quot;, &quot;heapsort&quot;, &quot;insertionsort&quot;, &quot;bininsertionsort&quot;]
</pre></p>
<p>I realize that this doesn&#8217;t give much in the way of explanation, but if anyone has questions, just comment and I&#8217;ll post clarifications.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iand675.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iand675.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iand675.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iand675.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iand675.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iand675.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iand675.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iand675.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iand675.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iand675.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iand675.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iand675.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iand675.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iand675.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iand675.wordpress.com&amp;blog=9393007&amp;post=14&amp;subd=iand675&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iand675.wordpress.com/2009/10/28/benchmark-suites-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ad8255d210af159175715be0e61bb872?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">iand675</media:title>
		</media:content>
	</item>
		<item>
		<title>Existentially Quantified Datatypes in Haskell: A Brief Overview for the Categorically Impaired</title>
		<link>http://iand675.wordpress.com/2009/09/09/existentially-quantified-datatypes-in-haskell/</link>
		<comments>http://iand675.wordpress.com/2009/09/09/existentially-quantified-datatypes-in-haskell/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 22:43:02 +0000</pubDate>
		<dc:creator>iand675</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iand675.wordpress.com/?p=8</guid>
		<description><![CDATA[I&#8217;ve been playing around with GHC a little bit and thought I would try to examine exactly what existential datatypes do. I will keep this post rather informal to share my intuitions that I&#8217;ve gained so far into a non-standard part of Haskell that appears to have some interesting uses, partially in an effort to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iand675.wordpress.com&amp;blog=9393007&amp;post=8&amp;subd=iand675&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around with GHC a little bit and thought I would try to examine exactly what existential datatypes do. I will keep this post rather informal to share my intuitions that I&#8217;ve gained so far into a non-standard part of Haskell that appears to have some interesting uses, partially in an effort to make this post accessible to those that don&#8217;t approach Haskell from a well-versed mathematical background and partially because I am not so bold as to attempt treating the subject formally when I have only learned a little through experimentation. Any corrections to this post would be greatly appreciated.</p>
<p>With that said, we will make use of a contrived example for the sake of simplicity . I don&#8217;t seem to have code highlighting, so apologies in advance for that; however, this post is a Literate Haskell file, so you can copy this into a plaintext file and all will be well.</p>
<p>To start off, we enable the existential quantification extension:</p>
<p>&gt; {-# LANGUAGE ExistentialQuantification #-}</p>
<p>Existentially quantified datatypes essentially allow you to hide the type values of a datatype&#8217;s parameters from the outside world. As a simple example, consider the following:</p>
<p>&gt; data Thingum a = forall b. Show b =&gt; Thing b a</p>
<p>Ignoring the &#8220;forall b. Show b =&gt;&#8221; segment for a moment, notice that a type variable b is used in the type constructor Thing but doesn&#8217;t appear in the datatype&#8217;s type signature. Indeed, if we examine the kind of Thingum, we&#8217;ll notice something odd: Thing has the kind (* -&gt; *)! If we write Thingum as &#8220;data Thingum a b = Thing b a&#8221;, (b being an instance of Show doesn&#8217;t really matter for kinds), then the kind comes out as (* -&gt; * -&gt; *). What each * on the left hand of an arrow denotes is a &#8220;slot&#8221; for a type that needs to be filled in in order for us to get any real result out of calculations involving this type. Thus, with our existentially quantified datatype, the data of type b inside of Bm is essentially inaccessible outside of Bm. This is where &#8220;forall b. Show b =&gt;&#8221; comes in. By declaring that the type variable b <em>must</em> be an instance of show, we can, in a limited way, interact with b. Here&#8217;s what I mean demonstrated through an example:</p>
<p>We&#8217;ll declare a new type Foo:</p>
<p>&gt; data Foo = forall a. Test a</p>
<p>So far so good. In fact, this is rather exciting! We can put any type of &#8220;a&#8221; we want into this datatype! Congratulations, we just bypassed Haskell&#8217;s type system! Well, not really. Can you think of why? Here&#8217;s a hint: think about what happens when we want to free our type from its Test container.</p>
<p>Let&#8217;s define a function to do just that:</p>
<p>&gt; bar :: Foo -&gt; a</p>
<p>&gt; bar (Test x) = x</p>
<p>Uhhh&#8230; well what is the x? And why isn&#8217;t this compiling? Is x a String? Is it an Int? Is it a function? Now that we have this value, what can we do with it? Well, with just this code, we can&#8217;t really do anything with it because we can&#8217;t know what functions can accommodate x as a parameter. This is why we need the value to be of a type that has is an instance of a typeclass, such as &#8220;forall b. Show b&#8221; in our first example. (Note that the forall in this context simply gives the compiler a hint that we explicitly want b to be existentially quantified in our datatype). Now, Haskell has <span style="text-decoration:underline;">a fact</span> about b that it can work with. We know that when all is said and done, we can convert b into a String and do something useful with it. We can toss any showable thing we want into the b slot, and when we decide we want to read about it, we are able to because the compiler can verify that show works at compile time:</p>
<p>&gt; showHidden (Thing showMe _) = show showMe</p>
<p>Bam! We&#8217;ve freed our b from its chains, and have done so in a typesafe way. However, the only way out for a value of type b in this example is through the show function. So,  unless you only intend to be using b as a string, it would be prudent to ensure that the typeclass instance that you use can fully support the features you need.</p>
<p>I&#8217;ll leave it to your imagination to come up with more interesting uses for this, but this just about covers the basics. Feel free to comment with any interesting uses of existentially qualified types. I&#8217;d love to see what people do with these odd extensions to Haskell98.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iand675.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iand675.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iand675.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iand675.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iand675.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iand675.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iand675.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iand675.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iand675.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iand675.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iand675.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iand675.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iand675.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iand675.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iand675.wordpress.com&amp;blog=9393007&amp;post=8&amp;subd=iand675&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iand675.wordpress.com/2009/09/09/existentially-quantified-datatypes-in-haskell/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ad8255d210af159175715be0e61bb872?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">iand675</media:title>
		</media:content>
	</item>
		<item>
		<title>On Minimalism</title>
		<link>http://iand675.wordpress.com/2009/09/09/on-minimalism/</link>
		<comments>http://iand675.wordpress.com/2009/09/09/on-minimalism/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 04:15:33 +0000</pubDate>
		<dc:creator>iand675</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iand675.wordpress.com/?p=3</guid>
		<description><![CDATA[Over the last several years, I&#8217;ve become more and more interested in the concept of Minimalism. It appeals to me artistically, architecturally, and philosophically. The standard Western mindset maintains an intense focus upon consumerism and materialism, stressing that fulfillment comes through accumulating wealth and expending that wealth on goods and entertainment. I find this entire [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iand675.wordpress.com&amp;blog=9393007&amp;post=3&amp;subd=iand675&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Over the last several years, I&#8217;ve become more and more interested in the concept of <a class="alignleft" title="Minimalism" href="http://en.wikipedia.org/wiki/Minimalism" target="_blank">Minimalism.</a></p>
<p>It appeals to me artistically, architecturally, and philosophically. The standard Western mindset maintains an intense focus upon consumerism and materialism, stressing that fulfillment comes through accumulating wealth and expending that wealth on goods and entertainment. I find this entire mindset terribly disturbing, if only because of the fact that the urge to obtain the latest and greatest powerfully grips me from time to time, urging me to forsake contentment in favor of placing my nose to the grindstone just to obtain something I will rarely use and previously didn&#8217;t even know I needed. However, consumerism isn&#8217;t content to stop just at inducing our pack-rat tendencies; the widespread growth of internet communications encourages what I&#8217;ll term informational consumerism. Email, Twitter, Facebook, Blogs, reddit, and Wikipedia place near-limitless amounts of information at our fingertips. These facilities in moderation have the power to be incredibly useful, but for many have grown into subconsciously compulsive obsessions.</p>
<p>A bored person coupled with an internet connection provide a new realm for consumerism that brings out the same pathological tendencies that Western society has dealt with for the last seventy years when dealing with material goods. I&#8217;ve learned from experience the veracity of this.</p>
<p>Much as a shopping channel addict can&#8217;t help but whip out a phone and credit card at the words &#8220;BUY NOW!&#8221;, for several years I have struggled with getting things done in the face of the internet. Without thinking, I would find myself absently typing in facebook.com, closing the tab after ascertaining that nothing new had occurred, only to immediately open a new tab and go to Facebook once more. As I discovered Digg, reddit, and more, I found that more and more of my time was spent refreshing pages obsessively.</p>
<p>I know that this is not just me. As a resident assistant at a college dorm, as I walk down the halls I see room after room of guys sitting in front of the computer, absently clicking away as a means of avoiding homework. Unlike most addictions, the internet is nearly impossible to get away from. It is from this perspective that I espouse minimalism as a very necessary tool for surviving the modern world; A quiz testing one&#8217;s knowledge about Disney characters, another Lolcat, or another chainmail from Uncle Rudolph is in fact rather detrimental to living well.</p>
<p>These distractions take our focus away from the real work and play in our lives. As I have stripped down mailing list subscriptions, ruthlessly blocked addictive websites on my computer, deleted old bookmarks, uninstalled rarely used applications and more, I have felt a burden lift from my shoulders. The tension of having to cram in work and play in between multiple-hour sessions of reddit browsing is at an end. The apathy about checking my email is gone, because I don&#8217;t have to wade through piles of junk just to find important emails.</p>
<p>I could say more, but instead I&#8217;ll heartily recommend <a title="Minimal Mac" href="http://minimalmac.com" target="_blank">Minimal Mac</a> and <a title="mnmlist" href="http://mnmlist.com" target="_blank">mnmlist.com</a> for inspiration and ideas. Even if you don&#8217;t face these problems in a computer-oriented environment, I strongly recommend taking an area in life that feels sluggish and unproductive and stripping out everything but the essentials and giving the Minimalist approach a try. It can do wonders.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iand675.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iand675.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iand675.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iand675.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iand675.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iand675.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iand675.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iand675.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iand675.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iand675.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iand675.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iand675.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iand675.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iand675.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iand675.wordpress.com&amp;blog=9393007&amp;post=3&amp;subd=iand675&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iand675.wordpress.com/2009/09/09/on-minimalism/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ad8255d210af159175715be0e61bb872?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">iand675</media:title>
		</media:content>
	</item>
	</channel>
</rss>
