Commits

Anonymous committed 1d5c3b0

Begin updates for jaxconf

Comments (0)

Files changed (1)

 		<li class="slide"><em>Functional design patterns</em></li>
 		<li class="slide">There's mostly* nothing magical about these typeclasses</li>
 		<li class="slide">In scala, they're provided by a library called scalaz (pronounced scala-zed)</li>
-		<li class="slide">These examples are based on <a href="https://github.com/scalaz/scalaz/tree/scalaz-seven">scalaz-seven</a></li>
+		<li class="slide">These examples are based on <a href="https://github.com/scalaz/scalaz/">scalaz 7.0.0</a></li>
 		<li class="slide">This is how the hierarchy is defined in Haskell--- it isn't perfect</li>
 	</ul>
 	<p class="slide">We'll cover functors, applicative functors, and monads</p>
 
 <section class="slide">
 	<img src="images/macaulay.jpg" style="float: right; width: 100%;">
-	<h3>(The Macaulay Culkin Operator)</h3>
+	<h3>(The Macaulay Culkin Function)</h3>
 </section>
 
 <section class="slide">
 	</div>
 </section>
 
+<section class="slide">
+	<h2>One more motivating example</h2>
+	<p>Recall that there is a functor instance for functions:</p>
+	<pre>
+	implicit def FunctionFunctor[R] = new Functor[({type l[a] = R=>a})#l] {
+		def map[A, B](fa: R => A)(f: A => B) : R => B = (x => f(fa(x)))
+	}
+	</pre>
+	<div class="slide">
+		<p>What about a monad instance?</p>	
+		<pre>
+		implicit def FunctionMonad[R] = new Monad[({type l[a] = R=>a})#l] {
+			def flatMap[A, B](fa: R => A)(f: A => R => B) : R => B = (x => f(fa(x))(x))
+			...
+		}
+		</pre>
+	</div>
+	<div class="slide">
+		<p>This is commonly referred to as the Reader monad. Here's why:</p>
+		<pre>
+			
+		</pre>
+	</div>	
+</section>
+
 </body>
 </html>