<?xml version="1.0" encoding="UTF-8"?><rss version="0.92">
<channel>
	<title>The Haskell School of Expression: Exercises</title>
	<link>http://www.elbeno.com/haskell_soe_blog</link>
	<description>solutions from the exercises in the book</description>
	<lastBuildDate>Mon, 30 Mar 2009 06:46:50 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	<!-- generator="WordPress/3.0" -->

	<item>
		<title>Exercise 11.1</title>
		<description><![CDATA[1) Prove that (∀cs &#124; cs is finite) putCharList cs = map putChar cs where putCharList &#91;&#93; = &#91;&#93; putCharList &#40;c:cs&#41; = putChar c : putCharList cs &#160; map f &#91;&#93; = &#91;&#93; map f &#40;x:xs&#41; = f x : map f xs Base case: putCharList &#91;&#93; =&#62; &#91;&#93; =&#62; map putChar &#91;&#93; Inductive Step: [...]]]></description>
		<link>http://www.elbeno.com/haskell_soe_blog/?p=59</link>
			</item>
	<item>
		<title>Exercise 10.4</title>
		<description><![CDATA[A quick look at Graphics.SOE reveals that getWindowEvent is the right function to trap mouse down, up, and move events separately. {- maybeClear is useful for avoiding flicker when not dragging objects. A real flicker-free solution should use double-buffering of course - this code still flickers terribly while dragging. -} &#160; maybeClear :: Bool -&#62; [...]]]></description>
		<link>http://www.elbeno.com/haskell_soe_blog/?p=58</link>
			</item>
	<item>
		<title>Exercise 10.3</title>
		<description><![CDATA[Prove is, to my mind, a strong word. But by substitution we can show that these functions are equivalent. First, the originals: adjust :: &#91;&#40;Color, Region&#41;&#93; -&#62; Coordinate -&#62; &#40;Maybe &#40;Color, Region&#41;, &#91;&#40;Color, Region&#41;&#93;&#41; adjust regs p = case &#40;break &#40;\&#40;_,r&#41; -&#62; r `containsR` p&#41; regs&#41; of &#40;top, hit:rest&#41; -&#62; &#40;Just hit, top++rest&#41; &#40;_, &#91;&#93;&#41; [...]]]></description>
		<link>http://www.elbeno.com/haskell_soe_blog/?p=57</link>
			</item>
	<item>
		<title>Exercise 10.2</title>
		<description><![CDATA[Simply run the code given in the book. The Graphics.SOE package seems to be buggy with respect to updating the window properly. I had redraw bugs using both GHCI and Hugs (using Ubuntu 7.10 on x86_84).]]></description>
		<link>http://www.elbeno.com/haskell_soe_blog/?p=56</link>
			</item>
	<item>
		<title>Exercise 10.1</title>
		<description><![CDATA[This exercise is simply to execute the code given in the book. To draw the &#8220;five circles&#8221; example: draw &#34;five circles&#34; $ Region Blue $ Translate &#40;-2,0&#41; $ Scale &#40;0.5, 0.5&#41; fiveCircles Note: Technical errors 17, 18 and 19 apply to the code (in particular shapeToGRegion) in Chapter 10.]]></description>
		<link>http://www.elbeno.com/haskell_soe_blog/?p=55</link>
			</item>
	<item>
		<title>Exercise 9.12</title>
		<description><![CDATA[Instances where we can curry and convert anonymous functions to sections are easy to find, for example from Exercise 5.5: doubleEach'' :: &#91;Int&#93; -&#62; &#91;Int&#93; doubleEach'' = map &#40;*2&#41;]]></description>
		<link>http://www.elbeno.com/haskell_soe_blog/?p=54</link>
			</item>
	<item>
		<title>Exercise 9.11</title>
		<description><![CDATA[map f &#40;map g xs&#41; = map &#40;f.g&#41; xs &#160; map &#40;\x -&#62; &#40;x+1&#41;/2&#41; xs = map &#40;/2&#41; &#40;map &#40;+1&#41; xs&#41;]]></description>
		<link>http://www.elbeno.com/haskell_soe_blog/?p=53</link>
			</item>
	<item>
		<title>Exercise 9.10</title>
		<description><![CDATA[map &#40;&#40;/2&#41;.&#40;+1&#41;&#41; xs]]></description>
		<link>http://www.elbeno.com/haskell_soe_blog/?p=52</link>
			</item>
	<item>
		<title>Exercise 9.9</title>
		<description><![CDATA[fix f = f &#40;fix f&#41; First, f takes the result of fix f, and second, the return type of f must be the same as the return type of fix. fix :: &#40;a -&#62; a&#41; -&#62; a Research shows that fix is the Fixed point combinator (or Y-combinator). Apparently this allows the definition of [...]]]></description>
		<link>http://www.elbeno.com/haskell_soe_blog/?p=51</link>
			</item>
	<item>
		<title>Exercise 9.8</title>
		<description><![CDATA[power :: &#40;a -&#62; a&#41; -&#62; Int -&#62; a -&#62; a power f 0 = &#40;\x -&#62; x&#41; power f n = &#40;\x -&#62; f &#40;power f &#40;n-1&#41; x&#41;&#41; Since the function is called power, there is one obvious application that springs to mind, i.e. raising to a power: raise :: Int -&#62; Int -&#62; [...]]]></description>
		<link>http://www.elbeno.com/haskell_soe_blog/?p=50</link>
			</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.364 seconds -->
