<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>
      Marakana
      -
      Forums</title>
    <link>
      http://marakana.com/forums/blog/
        </link>
    <copyright>2012 Marakana Inc, purveyors of fine training since 2005.</copyright><generator>Marakana Spark</generator>
    <item>
        <title>a more readable type lambda trick</title>
        <link>http://marakana.com/forums/scala/examples/665.html</link>
        <author>Dan Rosen</author>
        <guid isPermaLink="true">http://marakana.com/forums/scala/examples/665.html</guid>
        <pubDate>Sat, 31 Mar 2012 09:43:58 -0700</pubDate>
        <category>Scala - Examples</category>
        <content:encoded><![CDATA[So you've got some type that takes multiple type parameters, like:<br/><br/><div class="code">
		    <span>Code:</span><br/>
		    <pre style="height:expression(this.scrollHeight > 350 ? '350px' : 'auto');">trait State[S, A]<br/></pre>
		  </div><br/><br/>... and you've got some code that needs to fix one of the type parameters while letting the other(s) vary.  We usually use the "type lambda trick" to partially apply type arguments, like this:<br/><br/><div class="code">
		    <span>Code:</span><br/>
		    <pre style="height:expression(this.scrollHeight > 350 ? '350px' : 'auto');">def stateMonad[S] = new Monad[({type L[A] = State[S, A]})#L] { ... }<br/></pre>
		  </div><br/><br/>Sometimes you see this written with actual Greek characters using Unicode, where "L" is written as a lower case lambda, hence the name.  Using Greek letters in source code is for jerks, unless you happen to actually be Greek, in which case go for it.  However, even with the Latin "L" I don't find this style of code particularly readable, when some type lambda needs to be given a name and referenced more than once.  <strong>So I propose the following new convention:</strong><br/><br/><div class="code">
		    <span>Code:</span><br/>
		    <pre style="height:expression(this.scrollHeight > 350 ? '350px' : 'auto');">def stateMonad[S] = {<br/>  type `State[S]`[A] = State[S, A]<br/>  new Monad[`State[S]`] { ... }<br/>}<br/></pre>
		  </div><br/><br/>The backticks permit use of the special <code class="inline">[]</code> characters which wouldn't otherwise be allowed in an identifier.  At any rate, the idea is to mimic the appearance of <a href="https://issues.scala-lang.org/browse/SI-4719" rel="nofollow">multiple type parameter lists</a> without yet having them in the Scala language.]]></content:encoded>
      </item>
    <item>
        <title>Android Bootcamp 2012: A new video tutorial every weekday</title>
        <link>http://marakana.com/forums/android/general/627.html</link>
        <author>Max Walker</author>
        <guid isPermaLink="true">http://marakana.com/forums/android/general/627.html</guid>
        <pubDate>Mon, 06 Feb 2012 13:24:15 -0800</pubDate>
        <category>Android - General</category>
        <content:encoded><![CDATA[Two quick announcements. First off, last week we kicked off <a href="http://marakana.com/s/android_bootcamp_series_2012_video_tutorial,1017/index.html" rel="nofollow">Android Bootcamp Series 2012</a> - the definitive guide to getting started with Android development. We'll be releasing a new video tutorial every weekday. <br/><br/>Secondly, we've recently launched an alpha version of <a href="http://marakana.com/s/" rel="nofollow">Marakana Stream</a>, an easier way (hopefully) for you to browse through our ever-expanding library of educational content on open source development.<br/><br/><strong>Summary:</strong> go check out <a href="http://marakana.com/s/android_bootcamp_series_2012_video_tutorial,1017/index.html" rel="nofollow">Android Bootcamp Series 2012</a> at <a href="http://marakana.com/s/" rel="nofollow">Marakana Stream</a><br/><br/><img src="http://marakana.com/static/techtv/images/AB12.jpg" alt=""/><br/>]]></content:encoded>
      </item>
    </channel>
</rss>