<?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.post899713037400110773..comments</id><updated>2009-11-29T09:06:35.307-08: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: Tying Knots Generically</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.sigfpe.com/feeds/899713037400110773/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2006/12/tying-knots-generically.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>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-11295132.post-3135307680864864799</id><published>2009-11-29T09:02:29.619-08:00</published><updated>2009-11-29T09:02:29.619-08:00</updated><title type='text'>Unfortunately, the function loeb given in the text...</title><content type='html'>Unfortunately, the function loeb given in the text does not produce a circular data structure with pointers into itself; rather, it produces an infinite stream of identical data structures (indexed by successive calls to loeb) each with pointers into the next.  To see this, one needs to add an observable side-effect:&lt;br /&gt;&lt;br /&gt;&amp;gt; import Debug.Trace&lt;br /&gt;&lt;br /&gt;&amp;gt; zlist&amp;#39; = [\z -&amp;gt; Node i (z!!!((i-1) `mod` 100)) (z!!!((i+1) `mod` 100)) | i &amp;lt;- [0..99]]&lt;br /&gt;&amp;gt;          where lst !!! ind = trace (&amp;quot;indexing &amp;quot; ++ show ind) $ lst !! ind&lt;br /&gt;&lt;br /&gt;&amp;gt; z&amp;#39; = loeb zlist&amp;#39;&lt;br /&gt;&lt;br /&gt;Note how the first time one asks for, say, the lft of some node, it runs down the list looking for it&lt;br /&gt;&lt;br /&gt;&amp;gt; val $ lft $ head z&amp;#39;&lt;br /&gt;indexing 99&lt;br /&gt;99&lt;br /&gt;&lt;br /&gt;but the second time, that reference is cached&lt;br /&gt;&lt;br /&gt;&amp;gt; val $ lft $ head z&amp;#39;&lt;br /&gt;99&lt;br /&gt;&lt;br /&gt;Now we can tell that rt . lft does not get us the same node, because the lft of that node has to run down the list again.&lt;br /&gt;&lt;br /&gt;&amp;gt; val $ lft $ rt $ lft $ head z&amp;#39;&lt;br /&gt;indexing 0&lt;br /&gt;indexing 99&lt;br /&gt;99&lt;br /&gt;&lt;br /&gt;The &amp;quot;indexing 99&amp;quot; is repeated, and shouldn&amp;#39;t be.&lt;br /&gt;&lt;br /&gt;Fortunately, this bug can be fixed:&lt;br /&gt;&lt;br /&gt;&amp;gt; loeb&amp;#39; x = result where result = fmap (\a -&amp;gt; a result) x&lt;br /&gt;&lt;br /&gt;&amp;gt; z&amp;#39;&amp;#39; = loeb&amp;#39; zlist&amp;#39;&lt;br /&gt;&lt;br /&gt;&amp;gt; val $ lft $ head z&amp;#39;&amp;#39;&lt;br /&gt;indexing 99&lt;br /&gt;99&lt;br /&gt;&lt;br /&gt;&amp;gt; val $ lft $ rt $ lft $ head z&amp;#39;&amp;#39;&lt;br /&gt;indexing 0&lt;br /&gt;99&lt;br /&gt;&lt;br /&gt;Now rt . lft really does get us back to the same node, as intended.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default/3135307680864864799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default/3135307680864864799'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2006/12/tying-knots-generically.html?showComment=1259514149619#c3135307680864864799' title=''/><author><name>Alexey</name><uri>http://www.blogger.com/profile/11095629814500390449</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/2006/12/tying-knots-generically.html' ref='tag:blogger.com,1999:blog-11295132.post-899713037400110773' source='http://www.blogger.com/feeds/11295132/posts/default/899713037400110773' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1948543476'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-2404874845705242240</id><published>2007-01-02T11:40:00.000-08:00</published><updated>2007-01-02T11:40:00.000-08:00</updated><title type='text'>Ah...'Naperian' is just the concept I need to help...</title><content type='html'>Ah...'Naperian' is just the concept I need to help thinking about these things.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default/2404874845705242240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default/2404874845705242240'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2006/12/tying-knots-generically.html?showComment=1167766800000#c2404874845705242240' 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/2006/12/tying-knots-generically.html' ref='tag:blogger.com,1999:blog-11295132.post-899713037400110773' source='http://www.blogger.com/feeds/11295132/posts/default/899713037400110773' 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-6732519045494187183</id><published>2007-01-02T01:24:00.000-08:00</published><updated>2007-01-02T01:24:00.000-08:00</updated><title type='text'>Your tautological containers remind me of Peter Ha...</title><content type='html'>Your tautological containers remind me of Peter Hancock's &lt;a href="http://sneezy.cs.nott.ac.uk/containers/blog/?p=14"&gt;Naperian functors&lt;/a&gt;. These are containers of fixed shape (such as the pairs, streams, and ("a","b")-dictionaries you use as examples). The names comes from the fact that they have a notion of "position", which has many of the properties of a logarithm.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default/6732519045494187183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default/6732519045494187183'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2006/12/tying-knots-generically.html?showComment=1167729840000#c6732519045494187183' title=''/><author><name>Jeremy</name><uri>http://www.blogger.com/profile/03945885134870183516</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/2006/12/tying-knots-generically.html' ref='tag:blogger.com,1999:blog-11295132.post-899713037400110773' source='http://www.blogger.com/feeds/11295132/posts/default/899713037400110773' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1081642033'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-4306133381550667082</id><published>2006-12-29T21:13:00.000-08:00</published><updated>2006-12-29T21:13:00.000-08:00</updated><title type='text'>ski,

u = loebM [const (Just 1),Nothing]

Works lo...</title><content type='html'>ski,&lt;br /&gt;&lt;br /&gt;u = loebM [const (Just 1),Nothing]&lt;br /&gt;&lt;br /&gt;Works lovely.&lt;br /&gt;&lt;br /&gt;But then I try:&lt;br /&gt;&lt;br /&gt;import Prelude hiding ((!!))&lt;br /&gt;...&lt;br /&gt;(!!) :: [a] -&gt; Int -&gt; Maybe a&lt;br /&gt;[] !! _ = Nothing&lt;br /&gt;a !! 0 = Just $ head a&lt;br /&gt;a !! n = do&lt;br /&gt;    x &lt;- (tail a) !! (n-1)&lt;br /&gt;    return x&lt;br /&gt;&lt;br /&gt;u = loebM [const (Just 1),!!0]&lt;br /&gt;&lt;br /&gt;and that fails to terminate. The intention is that if !!n returns Nothing then the whole thing should fail with Nothing.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default/4306133381550667082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default/4306133381550667082'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2006/12/tying-knots-generically.html?showComment=1167455580000#c4306133381550667082' 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/2006/12/tying-knots-generically.html' ref='tag:blogger.com,1999:blog-11295132.post-899713037400110773' source='http://www.blogger.com/feeds/11295132/posts/default/899713037400110773' 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-4721851611123310833</id><published>2006-12-29T14:32:00.000-08:00</published><updated>2006-12-29T14:32:00.000-08:00</updated><title type='text'>How about the following ?

  import Control.Monad....</title><content type='html'>How about the following ?&lt;br /&gt;&lt;br /&gt;  import Control.Monad.Fix&lt;br /&gt;&lt;br /&gt;  class Monad m =&gt; MFunctor m f&lt;br /&gt;    where&lt;br /&gt;    fmapM :: (a -&gt; m b) -&gt; (f a -&gt; m (f b))&lt;br /&gt;&lt;br /&gt;  instance Monad m =&gt; MFunctor m []&lt;br /&gt;    where&lt;br /&gt;    fmapM = mapM&lt;br /&gt;&lt;br /&gt;  pamfM :: MFunctor m f =&gt; f a -&gt; (a -&gt; m b) -&gt; m (f b) &lt;br /&gt;  pamfM = flip fmapM&lt;br /&gt;&lt;br /&gt;  loebM :: (MonadFix m,MFunctor m f) =&gt; f (f a -&gt; m a) -&gt; m (f a)&lt;br /&gt;  -- both works&lt;br /&gt;  loebM f = mdo let mfa = f `pamfM` ($ fa)&lt;br /&gt;                    fa &lt;- mfa &lt;br /&gt;                    return fa&lt;br /&gt;  loebM f = mfix $ \fa -&gt; do&lt;br /&gt;    f `pamfM` ($ fa) &lt;br /&gt;&lt;br /&gt;  u = loebM [const (Just 1),const (Just 2)]&lt;br /&gt;  -- &gt; u &lt;br /&gt;  -- Just [1,2]                                                                 &lt;br /&gt;&lt;br /&gt;-- Stefan Ljungstrand</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default/4721851611123310833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default/4721851611123310833'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2006/12/tying-knots-generically.html?showComment=1167431520000#c4721851611123310833' title=''/><author><name>ski</name><uri>http://www.blogger.com/profile/10190106980684029949</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/2006/12/tying-knots-generically.html' ref='tag:blogger.com,1999:blog-11295132.post-899713037400110773' source='http://www.blogger.com/feeds/11295132/posts/default/899713037400110773' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-300365760'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-7458100782296692801</id><published>2006-12-28T11:41:00.000-08:00</published><updated>2006-12-28T11:41:00.000-08:00</updated><title type='text'>joesf,

I had more or less convinced myself that l...</title><content type='html'>joesf,&lt;br /&gt;&lt;br /&gt;I had more or less convinced myself that loebM was impossible but I think you've put the final nail in the coffin. In fact, I think that something like loebM isn't necessarily the best way to handle errors in this situation anyway and that with a bit of extra work, you can still use loeb.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default/7458100782296692801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default/7458100782296692801'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2006/12/tying-knots-generically.html?showComment=1167334860000#c7458100782296692801' 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/2006/12/tying-knots-generically.html' ref='tag:blogger.com,1999:blog-11295132.post-899713037400110773' source='http://www.blogger.com/feeds/11295132/posts/default/899713037400110773' 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-1856801064054237350</id><published>2006-12-28T10:52:00.000-08:00</published><updated>2006-12-28T10:52:00.000-08:00</updated><title type='text'>I don't have a solution to your loebM puzzle but a...</title><content type='html'>I don't have a solution to your loebM puzzle but an explanation as to why it fails.  Your definition of loebM requires that bind is lazy. What I mean is that bottom &gt;&gt;= f /= bottom. If bind is strict then loebM will inevitably diverge.&lt;br /&gt;&lt;br /&gt;Now, this leads to a bit of a problem because all monads that I know of that supply some kind of failure have strict binds. I conjecture that this must necessarily be the case, all monads will failure are strict. And this spells doom for you loebM.&lt;br /&gt;&lt;br /&gt;I guess you already was aware of this but I'd thought I'd spell it out. And the puzzle remains unsolved.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default/1856801064054237350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default/1856801064054237350'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2006/12/tying-knots-generically.html?showComment=1167331920000#c1856801064054237350' title=''/><author><name>Josef</name><uri>http://www.blogger.com/profile/13272830598221833253</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='32' src='http://photos1.blogger.com/blogger/2356/541/320/MyFace2.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2006/12/tying-knots-generically.html' ref='tag:blogger.com,1999:blog-11295132.post-899713037400110773' source='http://www.blogger.com/feeds/11295132/posts/default/899713037400110773' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1556760034'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-882201097290736352</id><published>2006-12-28T06:49:00.000-08:00</published><updated>2006-12-28T06:49:00.000-08:00</updated><title type='text'>For some reason your loeb function reminded me a l...</title><content type='html'>For some reason your loeb function reminded me a lot of the List-ana(morphism) function from the webpage: http://www.cs.indiana.edu/~jsobel/Recycling/recycling.html&lt;br /&gt;&lt;br /&gt;Your definition of loeb:&lt;br /&gt;loeb f =&lt;br /&gt;  fmap (\a -&gt; a (loeb f)) f&lt;br /&gt;&lt;br /&gt;The definition of list_ana (translated to Haskell)&lt;br /&gt;&lt;br /&gt;list_ana psi = f&lt;br /&gt;  where f l = map f (psi l)&lt;br /&gt;&lt;br /&gt;If we generalize map to fmap then they seem nearly the same.  Now the list_ana won't type in Haskell, but this is due to an infinite type which surely could be solved by adding proper constructors and destructors.&lt;br /&gt;&lt;br /&gt;Could we perhaps say that loeb is a generalized ana-morphism, or is this reading too much into the seeming similarity.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default/882201097290736352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/899713037400110773/comments/default/882201097290736352'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2006/12/tying-knots-generically.html?showComment=1167317340000#c882201097290736352' title=''/><author><name>Christophe (vincenz)</name><uri>http://www.blogger.com/profile/02320035941417593372</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='26' height='32' src='http://www.notvincenz.com/wiki/uploads/Main/me2.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2006/12/tying-knots-generically.html' ref='tag:blogger.com,1999:blog-11295132.post-899713037400110773' source='http://www.blogger.com/feeds/11295132/posts/default/899713037400110773' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-805972662'/></entry></feed>
