Anonymous committed df9fda2

A little more clarification on functions-as-functors, again by appeal to Haskell.

Comments (0)

Files changed (2)

 	<h2>The Typeclassopedia</h2>
 	<img src="images/typeclassopedia.png" style="float: right; width: 100%; margin-left: 20px;">
 	<p>A set of interrelated typeclasses that have proven handy for structuring functional code:
-	<ul class="slide">
+	<ul>
 		<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>
 	<h6 class="slide">Pop quiz: I defined map in a slightly funky way. What simple concept is this expressing?</h6>
+	<div class="slide">
+		<p>Again, the Haskell version makes this much clearer. Start with <code>fmap</code>:</p>
+<pre class="haskell">
+    fmap :: (a -> b) -> f a -> f b	
+	</div>
+	<div class="slide">
+		<p>Substitute <code>r -> a</code> for <code>f a</code></p>
+<pre class="haskell">
+    fmap :: (a -> b) -> (r -> a) -> (r -> b)	
+	</div>
 	<p class="slide">Aside: This is where the "box" analogy starts falling apart, and we start throwing around vague terms like "computational context"...</p>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.