<?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>Lane&#039;s Blog</title>
	<atom:link href="http://blog.downstairspeople.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.downstairspeople.org</link>
	<description>Roguestar, Haskell, and Fun</description>
	<lastBuildDate>Mon, 30 Nov 2009 18:33:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Paintable User Interfaces</title>
		<link>http://blog.downstairspeople.org/2009/11/30/paintable-user-interfaces/</link>
		<comments>http://blog.downstairspeople.org/2009/11/30/paintable-user-interfaces/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 18:32:54 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.downstairspeople.org/?p=106</guid>
		<description><![CDATA[It seems like it should be possible to have some kind of GUI library in which user interface elements can be painted onto the screen frame-by-frame, instead of the common practice of assembling an object-oriented hierarchy of widgets.
I&#8217;m thinking of something like (rough ECMA-like pseudocode): 

static var clicks = 0;
drawRectangle( 0, 0, 100, 100)
drawText( 0, [...]]]></description>
			<content:encoded><![CDATA[<p>It seems like it should be possible to have some kind of GUI library in which user interface elements can be painted onto the screen frame-by-frame, instead of the common practice of assembling an object-oriented hierarchy of widgets.</p>
<p>I&#8217;m thinking of something like (rough ECMA-like pseudocode): </p>
<p><tt><br />
static var clicks = 0;</p>
<p>drawRectangle( 0, 0, 100, 100)<br />
drawText( 0, 50, "This button has been clicked " + clicks + " times" )<br />
drawClickListener( 0, 0, 100, 100, function() { clicks++ } )<br />
</tt></p>
<p>Now we should be able to wrap this &#8220;button&#8221; inside affine transformations and clipping operations.  We would call and draw the button during each frame of animation, and the button would cease to exist on the first frame in which it stopped being called.</p>
<p>I&#8217;m not looking for a revolutionary GUI paradigm; I just want the ability to do some specific, weird effects when the situation calls for it.  For example, a car driving by with a clickable button on it&#8217;s side.  If the button is behind a tree in the same scene, then it shouldn&#8217;t be click-able.</p>
<p>In fact, ideally, drawing user interface elements would use the same path as drawing visible shapes, but would pass in an event handler instead of a color or fill pattern.  I could even imagine that there would be one or more channels of callback information alongside the RGB channels.</p>
<p>This is in the category of &#8220;things that I can&#8217;t possibly be the first person to think of but haven&#8217;t actually ever seen done.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.downstairspeople.org/2009/11/30/paintable-user-interfaces/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>New Roguestar Screenshot: Gateway</title>
		<link>http://blog.downstairspeople.org/2009/09/26/new-roguestar-screenshot-gateway/</link>
		<comments>http://blog.downstairspeople.org/2009/09/26/new-roguestar-screenshot-gateway/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 02:20:53 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Roguestar]]></category>

		<guid isPermaLink="false">http://blog.downstairspeople.org/?p=96</guid>
		<description><![CDATA[When you are done on a planet, step through a gateway to move to the next one.
]]></description>
			<content:encoded><![CDATA[<div id="attachment_97" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.downstairspeople.org/wp-content/uploads/2009/09/roguestar-screenshot.jpg"><img src="http://blog.downstairspeople.org/wp-content/uploads/2009/09/roguestar-screenshot-300x173.jpg" alt="An Androsynth standing in front of a stargate." title="roguestar-screenshot" width="300" height="173" class="size-medium wp-image-97" /></a><p class="wp-caption-text">An Androsynth standing in front of a stargate.</p></div>
<p>When you are done on a planet, step through a gateway to move to the next one.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.downstairspeople.org/2009/09/26/new-roguestar-screenshot-gateway/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FactoryArrow</title>
		<link>http://blog.downstairspeople.org/2009/08/09/factoryarrow/</link>
		<comments>http://blog.downstairspeople.org/2009/08/09/factoryarrow/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 19:21:29 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Haskell]]></category>
		<category><![CDATA[RSAGL]]></category>

		<guid isPermaLink="false">http://blog.downstairspeople.org/?p=87</guid>
		<description><![CDATA[I&#8217;ve been playing around with an Arrow concept, which to my knowledge is original.  I&#8217;ve decided to call this a FactoryArrow:

newtype FactoryArrow m n a b = FactoryArrow { runFactory :: m (Kleisli n a b) }

Where m and n are Monads.  m is a single-pass initialization monad, while n is a multiple-pass [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around with an Arrow concept, which <em>to my knowledge</em> is original.  I&#8217;ve decided to call this a FactoryArrow:</p>
<p><code><br />
newtype FactoryArrow m n a b = FactoryArrow { runFactory :: m (Kleisli n a b) }<br />
</code></p>
<p>Where <tt>m</tt> and <tt>n</tt> are Monads.  <tt>m</tt> is a single-pass initialization monad, while <tt>n</tt> is a multiple-pass working monad.  The arrow supports all of the standard accessory arrow typeclasses, including <tt>ArrowLoop</tt> if <tt>n</tt> implements <tt>MonadFix</tt>, and <tt>ArrowApply</tt> if <tt>m</tt> and <tt>n</tt> are the same.</p>
<p>This arrow simply captures a two-phase initialize-and-run design pattern.</p>
<p>To the best of my imagination, there cannot be a corresponding useful FactoryMonad.  I would be extremely interested if anyone can contradict me on that point.</p>
<p>My current interest is in using the FactoryArrow as a replacement for the mealy-style arrows by using IORefs (or potentially even STM transaction variables) to store automaton states instead of unevaluated thunks.</p>
<p>The <a href="http://roguestar.downstairspeople.org/gitweb?p=rsagl.git;a=blob;f=RSAGL/FRP2/FactoryArrow.hs;h=1b6b74732da7ef803819602a892adf3bfb5551e0;hb=d3a506aca2bd244596f6b8879ca16bc4bda44c49">corresponding implementation</a> as of the time of this writing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.downstairspeople.org/2009/08/09/factoryarrow/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Vec is Good</title>
		<link>http://blog.downstairspeople.org/2009/05/05/vec-is-good/</link>
		<comments>http://blog.downstairspeople.org/2009/05/05/vec-is-good/#comments</comments>
		<pubDate>Tue, 05 May 2009 19:45:47 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Haskell]]></category>
		<category><![CDATA[RSAGL]]></category>

		<guid isPermaLink="false">http://blog.downstairspeople.org/?p=84</guid>
		<description><![CDATA[Last night I checked out Scott E. Dillard&#8217;s Vec library.  It&#8217;s a good, fast, pure implementation of the basic matrix operations applicable to 3D graphics.  Switching to Vec has shaved off quite a bit of time from one of my demo apps and relieved me of the need to maintain my own matrix [...]]]></description>
			<content:encoded><![CDATA[<p>Last night I checked out Scott E. Dillard&#8217;s <a href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Vec-0.9.6">Vec</a> library.  It&#8217;s a good, fast, pure implementation of the basic matrix operations applicable to 3D graphics.  Switching to Vec has shaved off quite a bit of time from one of my demo apps and relieved me of the need to maintain my own matrix manipulation code, which was causing me repeated headaches.</p>
<p>It&#8217;s very heavy with MPTCs, fundeps, and type families, which will cause ghc to render some pretty inane error messages, but if you&#8217;re already accustomed to this then it&#8217;s actually very straightforward to use.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.downstairspeople.org/2009/05/05/vec-is-good/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ANN: priority-sync</title>
		<link>http://blog.downstairspeople.org/2009/04/29/ann-priority-sync/</link>
		<comments>http://blog.downstairspeople.org/2009/04/29/ann-priority-sync/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 21:28:53 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.downstairspeople.org/?p=81</guid>
		<description><![CDATA[Provides cooperative task prioritization.
The priority-sync package on hackage.haskell.org.
$ cabal install priority-sync
$ git clone http://www.downstairspeople.org/git/priority-sync.git
Feedback will be greatly appreciated.  This package is a spin-off from my work on roguestar, where I need to do significant background processing while retaining enough resources to perform smooth animation.
]]></description>
			<content:encoded><![CDATA[<p>Provides cooperative task prioritization.</p>
<p>The <a href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/priority-sync">priority-sync</a> package on hackage.haskell.org.</p>
<p>$ cabal install priority-sync</p>
<p>$ git clone http://www.downstairspeople.org/git/priority-sync.git</p>
<p>Feedback will be greatly appreciated.  This package is a spin-off from my work on roguestar, where I need to do significant background processing while retaining enough resources to perform smooth animation.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.downstairspeople.org/2009/04/29/ann-priority-sync/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trends in Profiling Haskell</title>
		<link>http://blog.downstairspeople.org/2009/04/16/trends-in-profiling-haskell/</link>
		<comments>http://blog.downstairspeople.org/2009/04/16/trends-in-profiling-haskell/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 23:22:27 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Haskell]]></category>

		<guid isPermaLink="false">http://blog.downstairspeople.org/?p=68</guid>
		<description><![CDATA[I spent some time yesterday profiling roguestar.  I do this every few months just to see where things stand, and there are always two culprits at the top of roguestar-gl.prof, every single time:
* typeclass dictionary lookups in inner loops
* Rational
In the first case, I think the simplest solution is to INLINE the puppy.  [...]]]></description>
			<content:encoded><![CDATA[<p>I spent some time yesterday profiling roguestar.  I do this every few months just to see where things stand, and there are always two culprits at the top of roguestar-gl.prof, every single time:</p>
<p>* typeclass dictionary lookups in inner loops<br />
* Rational</p>
<p>In the first case, I think the simplest solution is to INLINE the puppy.  Can the ghc inliner be a little bit more aggressive when it sees dictionary lookups?  Inliners are tricky business.  I&#8217;m not sure I see a simple heuristic.  Vaguely: leaf functions that require dictionary lookups need to be specialized.</p>
<p>Rational can sneak into an unsuspecting program through <tt>realToFrac</tt>, and absolutely *kills* performance.</p>
<p>I sit down thinking to myself, &#8220;Ok, today I&#8217;m going to streamline my Super Mumbo Jumbo Widget and get 15% faster performance,&#8221; or some such goal I set for myself.  And I run the profiler and 75% of my time is being spent in <tt>fromRational . toRational</tt>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.downstairspeople.org/2009/04/16/trends-in-profiling-haskell/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Twilight Hero</title>
		<link>http://blog.downstairspeople.org/2009/03/22/twilight-hero/</link>
		<comments>http://blog.downstairspeople.org/2009/03/22/twilight-hero/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 18:12:19 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Roguestar]]></category>

		<guid isPermaLink="false">http://blog.downstairspeople.org/?p=55</guid>
		<description><![CDATA[
Here we see our hero fighting a recreant with a kinetic sabre.  The material spheres front and left can be used to repair yourself, while a phase rifle is to the right.  In unskilled hands, such powerful weapons can more dangerous to the user than enemy.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.downstairspeople.org/wp-content/uploads/2009/03/roguestar_melee_screenshot.png"><img src="http://blog.downstairspeople.org/wp-content/uploads/2009/03/roguestar_melee_screenshot-300x187.png" alt="Hero fights off recreant using the new melee rule mechanics for roguestar." title="roguestar_melee_screenshot" width="300" height="187" class="size-medium wp-image-54" /></a></p>
<p>Here we see our hero fighting a recreant with a kinetic sabre.  The material spheres front and left can be used to repair yourself, while a phase rifle is to the right.  In unskilled hands, such powerful weapons can more dangerous to the user than enemy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.downstairspeople.org/2009/03/22/twilight-hero/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MaybeArrow?</title>
		<link>http://blog.downstairspeople.org/2009/01/04/maybearrow/</link>
		<comments>http://blog.downstairspeople.org/2009/01/04/maybearrow/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 23:16:13 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Haskell]]></category>

		<guid isPermaLink="false">http://blog.downstairspeople.org/?p=53</guid>
		<description><![CDATA[As I&#8217;ve found myself repeatedly writing a bit of code that looked vaguely like this:


get :: SomeArrow String (Maybe Thing)

foo :: [Thing] -> FooThing

. . .

getAToZ :: SomeArrow () (Maybe FooThing)
getAToZ = proc () -&#62;
    do m_a &#60;- get -&#60; "a"
       m_b &#60;- get -&#60; "b"
 [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;ve found myself repeatedly writing a bit of code that looked vaguely like this:</p>
<p><tt></p>
<pre>
get :: SomeArrow String (Maybe Thing)

foo :: [Thing] -> FooThing

. . .

getAToZ :: SomeArrow () (Maybe FooThing)
getAToZ = proc () -&gt;
    do m_a &lt;- get -&lt; "a"
       m_b &lt;- get -&lt; "b"
       . . .
       m_z &lt;- get -&lt; "z"
       returnA -<
           do a &lt;- m_a
              b &lt;- m_b
              . . .
              z &lt;- m_z
              return $ foo [a,b . . . z]
</pre>
<p></tt></p>
<p></p>
<p>It seemed that there would have to be a way to automate this.  So I wrote this <tt><a href="http://roguestar.downstairspeople.org/gitweb?p=MaybeArrow.git;a=blob;f=MaybeArrow.hs;h=dbed9bc496ddc27409896b2c6dba2b44cf78ab20;hb=ab7a6cd9af621b05b854b33c13b611e0dfb5907a">MaybeArrow</a></tt> (careful, I'm still using 6.8.2 so it's the old arrows with 'pure'.).  I know that there is already an <tt>ErrorArrow</tt>.  But <tt>ErrorArrow</tt> as far as I can see requires <tt>ArrowChoice</tt>, and I'm not doing that.  In the <tt>MaybeArrow</tt>, if an earlier computation throws a <tt>Nothing</tt>, then later computations are still allowed to perform side effects, although their outputs are snuffed, which is the behavior I want.</p>
<p>I would appreciate any constructive feedback.</p>
<p>If you're wondering the use case has to do with waiting on several separate pieces of information to arrive from a server and combining them into one output message.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.downstairspeople.org/2009/01/04/maybearrow/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>A New Dawn?</title>
		<link>http://blog.downstairspeople.org/2008/11/04/a-new-dawn/</link>
		<comments>http://blog.downstairspeople.org/2008/11/04/a-new-dawn/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 06:10:08 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Roguestar]]></category>

		<guid isPermaLink="false">http://blog.downstairspeople.org/?p=50</guid>
		<description><![CDATA[This is what I imagine a very cold (~2000K) red star might look like at sunrise.  I&#8217;m not sure if it matters whether it is a red giant or red dwarf &#8212; the system tries to size the star semi-realistically according to the temperature of the star and the climate of the local planet, [...]]]></description>
			<content:encoded><![CDATA[<p>This is what I imagine a very cold (~2000K) red star might look like at sunrise.  I&#8217;m not sure if it matters whether it is a red giant or red dwarf &#8212; the system tries to size the star semi-realistically according to the temperature of the star and the climate of the local planet, so it should have about the same apparent size either way.  A blue star would always look very small, even though these stars are always giants, because if you were ever close enough that it looked big, it would just sterilize you.  </p>
<p>The mysterious green object in the upper right corner is a cyborg planet killer.  It&#8217;s really big and powerful, so don&#8217;t **** it off.</p>
<p><a href='http://blog.downstairspeople.org/wp-content/uploads/2008/11/red_giant_cyborg_planet_killer.jpg'><img src="http://blog.downstairspeople.org/wp-content/uploads/2008/11/red_giant_cyborg_planet_killer.jpg" alt="Red Giant Sunrise" title="red_giant_cyborg_planet_killer" width="300" height="225" class="alignnone size-medium wp-image-51" /></a></p>
<p>In other news, for my United Statesian readers, it&#8217;s election day!  All you have to do is show up, wait in line a little while, and draw a little line to the right arrowhead, or pull a lever or however it&#8217;s done in your state.  Try not to **** it up.  Unless you have electronic voting machines, in which case the cyborgs will take care of it, so don&#8217;t bother.</p>
<p>If you have astrophysics brains and don&#8217;t mind feeding them to my zombie code monkey, maybe I can make more realistic stars?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.downstairspeople.org/2008/11/04/a-new-dawn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Good Morning Planet Haskell</title>
		<link>http://blog.downstairspeople.org/2008/10/10/good-morning-planet-haskell/</link>
		<comments>http://blog.downstairspeople.org/2008/10/10/good-morning-planet-haskell/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 05:44:01 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Roguestar]]></category>

		<guid isPermaLink="false">http://blog.downstairspeople.org/?p=47</guid>
		<description><![CDATA[Here&#8217;s something I&#8217;ve been spending waaaay too much time on, but I wasn&#8217;t happy with the results the first try, or the second try, or the third try and . . . I can be very stubborn.

This is actually very low resolution.  It uses a simple media ray tracer that can handle some common [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s something I&#8217;ve been spending <i>waaaay</i> too much time on, but I wasn&#8217;t happy with the results the first try, or the second try, or the third try and . . . I can be very stubborn.</p>
<p><a href='http://blog.downstairspeople.org/wp-content/uploads/2008/10/good-morning-planet-haskell.jpg'><img src="http://blog.downstairspeople.org/wp-content/uploads/2008/10/good-morning-planet-haskell.jpg" alt="Encephalon at Dawn" title="good-morning-planet-haskell" width="150" height="112" class="alignnone size-thumbnail wp-image-48" /></a></p>
<p>This is actually very low resolution.  It uses a simple media ray tracer that can handle some common atmosphere models.  The tracer runs in a background thread and the result is just pasted onto a sky sphere.</p>
<p>More shots as I refine the lighting.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.downstairspeople.org/2008/10/10/good-morning-planet-haskell/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
