<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-11295132.post8648682395870958209..comments</id><updated>2008-09-29T12:38:25.550-07:00</updated><category term='category theory'/><category term='lawvere theories'/><category term='astronomy'/><category term='optimisation'/><category term='self-reference'/><category term='comonads'/><category term='haskell'/><category term='programming'/><category term='monad'/><category term='mathematics'/><category term='physics'/><category term='probability'/><category term='types'/><category term='quantum'/><title type='text'>Comments on A Neighborhood of Infinity: Exceptions, Disjunctions and Continuations</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.sigfpe.com/feeds/8648682395870958209/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html'/><author><name>sigfpe</name><uri>http://www.blogger.com/profile/08096190433222340957</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://homepage.mac.com/sigfpe/.Pictures/Photo%20Album%20Pictures/2002-12-07%2014.53.40%20-0800/ImageDSC01397_1.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-11295132.post-2819020567292508263</id><published>2008-09-28T20:21:00.000-07:00</published><updated>2008-09-28T20:21:00.000-07:00</updated><title type='text'>This is a fantastic post.  One of my favorite prog...</title><content type='html'>This is a fantastic post.  One of my favorite programming related articles in recent memory.&lt;BR/&gt;&lt;BR/&gt;Thanks to you and your readers for a lot of good old fashioned logic.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/2819020567292508263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/2819020567292508263'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html?showComment=1222658460000#c2819020567292508263' title=''/><author><name>devin</name><uri>http://www.blogger.com/profile/01183566927646186069</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html' ref='tag:blogger.com,1999:blog-11295132.post-8648682395870958209' source='http://www.blogger.com/feeds/11295132/posts/default/8648682395870958209' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-625931140'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-1137453073535945505</id><published>2007-11-04T10:10:00.000-08:00</published><updated>2007-11-04T10:10:00.000-08:00</updated><title type='text'>This stuff still continues to bake my noodle.  In ...</title><content type='html'>This stuff still continues to bake my noodle.  In the same spirit, I was playing with combinator types this lazy sunday afternoon, and came up with:&lt;BR/&gt;&lt;I&gt;&lt;BR/&gt;  K : a -&gt; (b -&gt; a)&lt;BR/&gt;==&gt;&lt;BR/&gt;  a -&gt; (!b or a)&lt;BR/&gt;==&gt;&lt;BR/&gt;  !a or (!b or a)&lt;BR/&gt;==&gt;&lt;BR/&gt;  b -&gt; (a or !a)&lt;BR/&gt;&lt;/I&gt;&lt;BR/&gt;which I read as "if &lt;I&gt;b&lt;/I&gt; is true, the law of the excluded middle holds for &lt;I&gt;a&lt;/I&gt;."  That is, the K combinator sets up a classical-logic sandbox for &lt;I&gt;a&lt;/I&gt; guarded by &lt;I&gt;b&lt;/I&gt;'s truth.  (Or, more likely, I'm totally confused.  It's entertaining either way.)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/1137453073535945505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/1137453073535945505'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html?showComment=1194199800000#c1137453073535945505' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html' ref='tag:blogger.com,1999:blog-11295132.post-8648682395870958209' source='http://www.blogger.com/feeds/11295132/posts/default/8648682395870958209' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1190348606'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-3722647953615111030</id><published>2007-09-18T16:49:00.000-07:00</published><updated>2007-09-18T16:49:00.000-07:00</updated><title type='text'>Thanks for your nice post!</title><content type='html'>Thanks for your nice post!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/3722647953615111030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/3722647953615111030'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html?showComment=1190159340000#c3722647953615111030' title=''/><author><name>Michael</name><uri>http://free-ps3-for-me.blogspot.com</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html' ref='tag:blogger.com,1999:blog-11295132.post-8648682395870958209' source='http://www.blogger.com/feeds/11295132/posts/default/8648682395870958209' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1114434096'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-2406648708508251160</id><published>2007-02-14T00:43:00.000-08:00</published><updated>2007-02-14T00:43:00.000-08:00</updated><title type='text'>import Control.Monad&lt;br&gt;import Control.Monad.Cont&lt;...</title><content type='html'>import Control.Monad&lt;BR/&gt;import Control.Monad.Cont&lt;BR/&gt;&lt;BR/&gt;-- compare with scheme at http://sigfpe.blogspot.com/2007/02/exceptions-disjunctions-and.html&lt;BR/&gt;&lt;BR/&gt;right b = (\exit -&gt; return b)&lt;BR/&gt;left a = (\exit -&gt; exit a)&lt;BR/&gt;&lt;BR/&gt;f x = return ("Left",x)&lt;BR/&gt;g x = return ("Right",x)&lt;BR/&gt;&lt;BR/&gt;either_ f g x = flip runCont id $ do&lt;BR/&gt;  callCC (\exit -&gt;&lt;BR/&gt;    (x (\y -&gt; f y &gt;&gt;= exit)) &gt;&gt;= g)&lt;BR/&gt;&lt;BR/&gt;&lt;BR/&gt;And then&lt;BR/&gt;&lt;BR/&gt;*Main&gt; either_ f g (left 'a')&lt;BR/&gt;("Left",'a')&lt;BR/&gt;*Main&gt; either_ f g (right 'a')&lt;BR/&gt;("Right",'a')</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/2406648708508251160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/2406648708508251160'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html?showComment=1171442580000#c2406648708508251160' title=''/><author><name>TuringTest</name><uri>http://www.blogger.com/profile/15256574983181139425</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html' ref='tag:blogger.com,1999:blog-11295132.post-8648682395870958209' source='http://www.blogger.com/feeds/11295132/posts/default/8648682395870958209' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1480180816'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-617771242249614519</id><published>2007-02-12T10:10:00.000-08:00</published><updated>2007-02-12T10:10:00.000-08:00</updated><title type='text'>Lots of answers to my exercise! Good thing I was a...</title><content type='html'>Lots of answers to my exercise! Good thing I was away from a net connection for most of the weekend and had a chance to figure it out for myself without seeing other people's answers!&lt;BR/&gt;&lt;BR/&gt;Understanding, in detail, exactly why control operators relate to classical logic has taken me a while to figure out. But having thought I grasped it, Derek has now pointed out a deeper level on which this can be viewed. I'll be busy thinking about that now...</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/617771242249614519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/617771242249614519'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html?showComment=1171303800000#c617771242249614519' title=''/><author><name>sigfpe</name><uri>http://www.blogger.com/profile/08096190433222340957</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html' ref='tag:blogger.com,1999:blog-11295132.post-8648682395870958209' source='http://www.blogger.com/feeds/11295132/posts/default/8648682395870958209' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-961546855'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-892881987545220388</id><published>2007-02-11T03:20:00.000-08:00</published><updated>2007-02-11T03:20:00.000-08:00</updated><title type='text'>I posted some comments over in the reddit submissi...</title><content type='html'>I posted some comments over in the reddit submission for this blog entry of yours:&lt;BR/&gt;&lt;BR/&gt;http://programming.reddit.com/info/13tjo/comments&lt;BR/&gt;&lt;BR/&gt;To summarize, i appears to me that catch should have type ((a -&gt; _|_) -&gt; a) -&gt; a,  not ~~a. That looks like Peirce's law to me, which should be equivalent to ~~a -&gt; a (but not ~~a), so maybe that's what you meant to write.&lt;BR/&gt;&lt;BR/&gt;I also posted a proposed solution to your exercise. It seemed too easy, so I'm sure I must have missed something!&lt;BR/&gt;&lt;BR/&gt;Anyway, great article!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/892881987545220388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/892881987545220388'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html?showComment=1171192800000#c892881987545220388' title=''/><author><name>Per Vognsen</name><uri>http://www.blogger.com/profile/06042681400980641198</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html' ref='tag:blogger.com,1999:blog-11295132.post-8648682395870958209' source='http://www.blogger.com/feeds/11295132/posts/default/8648682395870958209' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1762560682'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-4402645360037847828</id><published>2007-02-10T19:28:00.000-08:00</published><updated>2007-02-10T19:28:00.000-08:00</updated><title type='text'>In category theory we can define function types vi...</title><content type='html'>In category theory we can define function types via the parameterized adjunction,&lt;BR/&gt;Ax- -| A =&amp;gt; -.  Symmetry leads us to hope for another parameterized adjunction FA- -| A+-, but what is F?  In Set, it's nothing, A+- does not have a left adjoint.  However, in other categories, we it does.  Let's write it, - &amp;lt;= A.  It can be thought of something like a computation that either evaluates to a value of type - or throws a value of type A.  Filinski explores this in his &lt;A HREF="http://www.diku.dk/hjemmesider/ansatte/andrzej/papers" REL="nofollow"/&gt;.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/4402645360037847828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/4402645360037847828'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html?showComment=1171164480000#c4402645360037847828' title=''/><author><name>Derek Elkins</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html' ref='tag:blogger.com,1999:blog-11295132.post-8648682395870958209' source='http://www.blogger.com/feeds/11295132/posts/default/8648682395870958209' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-260622615'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-2123561784312294135</id><published>2007-02-10T19:11:00.000-08:00</published><updated>2007-02-10T19:11:00.000-08:00</updated><title type='text'>I haven’t read the post properly but just skimming...</title><content type='html'>I haven’t read the post properly but just skimming through the following struck me as odd:&lt;BR/&gt;&lt;BR/&gt;In other words, if we use the symbol ∨ to mean either, then exactly in classical logic, we have a ∨ b = ~a → b.&lt;BR/&gt;&lt;BR/&gt;But ∨ doesn’t mean either ≠ does. Then we only have a ≠ b  →  ~a → b.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/2123561784312294135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/2123561784312294135'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html?showComment=1171163460000#c2123561784312294135' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html' ref='tag:blogger.com,1999:blog-11295132.post-8648682395870958209' source='http://www.blogger.com/feeds/11295132/posts/default/8648682395870958209' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-676015486'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-291926533734115322</id><published>2007-02-10T19:05:00.000-08:00</published><updated>2007-02-10T19:05:00.000-08:00</updated><title type='text'>Well, one thing we can do with DeMorgan's law is d...</title><content type='html'>Well, one thing we can do with DeMorgan's law is do the classical to intuitionist embedding, and then interpret that in terms of, say Haskell types.&lt;BR/&gt;&lt;BR/&gt;a /\ b&lt;BR/&gt;becomes&lt;BR/&gt;(a -&gt; r) -&gt; r /\ (b -&gt; r) -&gt; r&lt;BR/&gt;which would correspond to the pair type:&lt;BR/&gt;((a -&gt; r) -&gt; r, (b -&gt; r) -&gt; r)&lt;BR/&gt;&lt;BR/&gt;~(~a \/ ~b)&lt;BR/&gt;becomes&lt;BR/&gt;~(~((a -&gt; r) -&gt; r) \/ ~((b -&gt; r) -&gt; r))&lt;BR/&gt;and, expanding the negations, and using ~~~a -&gt; ~a, we have:&lt;BR/&gt;~(a -&gt; r \/ b -&gt; r)&lt;BR/&gt;or:&lt;BR/&gt;(a -&gt; r \/ b -&gt; r) -&gt; r&lt;BR/&gt;for which in Haskell, we'd use:&lt;BR/&gt;Either (a -&gt; r) (b -&gt; r) -&gt; r&lt;BR/&gt;&lt;BR/&gt;The isomorphisms between these two types are easy to exhibit:&lt;BR/&gt;&lt;BR/&gt;f :: ((a -&gt; r) -&gt; r, (b -&gt; r) -&gt; r)&lt;BR/&gt;&amp;nbsp;&amp;nbsp;-&gt; (Either (a -&gt; r) (b -&gt; r) -&gt; r)&lt;BR/&gt;f (a,b) (Left c) = c a&lt;BR/&gt;f (a,b) (Right d) = d b&lt;BR/&gt;&lt;BR/&gt;g :: (Either (a -&gt; r) (b -&gt; r) -&gt; r)&lt;BR/&gt;&amp;nbsp;&amp;nbsp;-&gt; ((a -&gt; r) -&gt; r, (b -&gt; r) -&gt; r)&lt;BR/&gt;g a = (\b -&gt; a (Left b), \c -&gt; a (Right c))&lt;BR/&gt;&lt;BR/&gt;So this might be interpreted as saying that if we have an (a consumer) consumer, and a (b consumer) consumer, then it's the same as having something which can consume either an a consumer or b consumer.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/291926533734115322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/291926533734115322'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html?showComment=1171163100000#c291926533734115322' title=''/><author><name>Cale Gibbard</name><uri>http://www.blogger.com/profile/02239068589033148700</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html' ref='tag:blogger.com,1999:blog-11295132.post-8648682395870958209' source='http://www.blogger.com/feeds/11295132/posts/default/8648682395870958209' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1795144939'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-6715624766019173296</id><published>2007-02-10T18:36:00.000-08:00</published><updated>2007-02-10T18:36:00.000-08:00</updated><title type='text'>Just like the identity &lt;i&gt;a ∨ b = ~a -&amp;gt; b&lt;/i&gt; w...</title><content type='html'>Just like the identity &lt;I&gt;a ∨ b = ~a -&gt; b&lt;/I&gt; was a hint as to how &lt;I&gt;Either&lt;/I&gt; could be implemented, &lt;I&gt;a ∧ b = ~(~a ∨ ~b)&lt;/I&gt; similarly hints at an implementation of pairs. &lt;I&gt;(,) a b&lt;/I&gt; should thus return a thrower, that is, a function which takes an &lt;I&gt;Either ~a ~b&lt;/I&gt; and which does not return:&lt;BR/&gt;&lt;BR/&gt;&lt;I&gt;(,) :: a -&gt; b -&gt; ~(Either ~a ~b)&lt;/I&gt;&lt;BR/&gt;-- or, expanding the '~'s&lt;BR/&gt;&lt;I&gt;(,) :: a -&gt; b -&gt; (Either (a -&gt; ⊥) (b -&gt; ⊥)) -&gt; ⊥&lt;/I&gt;&lt;BR/&gt;&lt;I&gt;(,) a _ (Left a_thrower) = a_thrower a&lt;/I&gt;&lt;BR/&gt;&lt;I&gt;(,) _ b (Right b_thrower) = b_thrower b&lt;/I&gt;&lt;BR/&gt;&lt;BR/&gt;Getting the values back is a bit trickier, so let's build some scaffolding. When applying &lt;I&gt;call-with-current-continuation&lt;/I&gt; to a function of type &lt;I&gt;~a -&gt; b&lt;/I&gt;, the result could be either of type &lt;I&gt;a&lt;/I&gt; or &lt;I&gt;b&lt;/I&gt;, depending on whether the function calls its continuation or returns normally. Thus, &lt;I&gt;call&lt;B&gt;/&lt;/B&gt;cc&lt;/I&gt; itself must have type &lt;I&gt;(~a -&gt; b) -&gt; Either b a&lt;/I&gt;.&lt;BR/&gt;&lt;BR/&gt;As a special case, let &lt;I&gt;get&lt;B&gt;/&lt;/B&gt;a&lt;/I&gt; be the result of applying &lt;I&gt;call&lt;B&gt;/&lt;/B&gt;cc&lt;/I&gt; to the identity function of type &lt;I&gt;~a -&gt; ~a&lt;/I&gt;. This result must have type &lt;I&gt;Either ~a a&lt;/I&gt;. When &lt;I&gt;get&lt;B&gt;/&lt;/B&gt;a&lt;/I&gt; first returns, it will return a &lt;I&gt;Left ~a&lt;/I&gt;. If this thrower is applied to some value &lt;I&gt;a&lt;/I&gt;, control flow will bungee back to &lt;I&gt;get&lt;B&gt;/&lt;/B&gt;a&lt;/I&gt; and this time it will return a &lt;I&gt;Right a&lt;/I&gt;. We can use this construction to define our accessors as follows:&lt;BR/&gt;&lt;BR/&gt;&lt;I&gt;fst :: ~(Either ~a ~b) -&gt; a&lt;/I&gt;&lt;BR/&gt;&lt;I&gt;fst meta_thrower = case get&lt;B&gt;/&lt;/B&gt;a of&lt;/I&gt;&lt;BR/&gt;&lt;I&gt;&amp;nbsp;&amp;nbsp;Left a_thrower -&gt; meta_thrower (Left a_thrower)&lt;/I&gt;&lt;BR/&gt;&lt;I&gt;&amp;nbsp;&amp;nbsp;Right a -&gt; a&lt;/I&gt;&lt;BR/&gt;&lt;BR/&gt;&lt;I&gt;snd&lt;/I&gt; is defined symmetrically. When &lt;I&gt;fst&lt;/I&gt; is called, it captures the current continuation &lt;I&gt;a_thrower&lt;/I&gt; and passes it to the pair through &lt;I&gt;meta_thrower&lt;/I&gt;, along with the selector &lt;I&gt;Left&lt;/I&gt;. The pair then switches on the selector and gives the value &lt;I&gt;a&lt;/I&gt; to &lt;I&gt;a_thrower&lt;/I&gt;, which bungees &lt;I&gt;a&lt;/I&gt; back to &lt;I&gt;fst&lt;/I&gt;, which returns it.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/6715624766019173296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/6715624766019173296'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html?showComment=1171161360000#c6715624766019173296' title=''/><author><name>gelisam</name><uri>http://www.blogger.com/profile/15650058092785119000</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://is2.okcupid.com/users/112/10/11201006864632744892/p1149556960.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html' ref='tag:blogger.com,1999:blog-11295132.post-8648682395870958209' source='http://www.blogger.com/feeds/11295132/posts/default/8648682395870958209' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2112853205'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-7216116292875953267</id><published>2007-02-10T15:40:00.000-08:00</published><updated>2007-02-10T15:40:00.000-08:00</updated><title type='text'>Here is my interpretation of &amp;#39;a&amp;amp;b = ~(~a |...</title><content type='html'>Here is my interpretation of 'a&amp;b = ~(~a | ~b)'.&lt;BR/&gt;&lt;BR/&gt;Going from the left to right is valid even constructively, so I don't find it too strange.&lt;BR/&gt;It's realized by&lt;BR/&gt;f (a, b) = \ c -&gt;&lt;BR/&gt;    case c of&lt;BR/&gt;    Left d -&gt; d a&lt;BR/&gt;    Right e -&gt; e b&lt;BR/&gt;&lt;BR/&gt;Going from right to left involves throwing.&lt;BR/&gt;&lt;BR/&gt;So are given a function (~a | ~b) -&gt; _|_ and we have to produce an 'a' and a 'b'.&lt;BR/&gt;First give the function 'Left throw', it has no choice but to use that throw eventually and then we catch the 'a'.&lt;BR/&gt;Similarly, give it 'Right throw' and when it throws, catch the 'b'.  And the return (a, b).</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/7216116292875953267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/8648682395870958209/comments/default/7216116292875953267'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html?showComment=1171150800000#c7216116292875953267' title=''/><author><name>augustss</name><uri>http://www.blogger.com/profile/05153404423721072935</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2007/02/exceptions-disjunctions-and.html' ref='tag:blogger.com,1999:blog-11295132.post-8648682395870958209' source='http://www.blogger.com/feeds/11295132/posts/default/8648682395870958209' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1057072930'/></entry></feed>
