Comments on: Kan Extensions http://comonad.com/reader/2008/kan-extensions/ types, (co)monads, substructural logic Sat, 29 Dec 2012 15:18:06 -0800 http://wordpress.org/?v=2.8.4 hourly 1 By: zzo38 http://comonad.com/reader/2008/kan-extensions/comment-page-1/#comment-105351 zzo38 Wed, 27 Jun 2012 18:50:40 +0000 http://comonad.com/reader/2008/kan-extensions/#comment-105351 Can you make the constraint Kan extension? Such as (forall b. Monoid b => (a -> g b) -> h b) and so on. Or use the constraint kind to allow it a parameter. Can you make the constraint Kan extension? Such as (forall b. Monoid b => (a -> g b) -> h b) and so on. Or use the constraint kind to allow it a parameter.

]]>
By: The Comonad.Reader » Free Monads for Less (Part 2 of 3): Yoneda http://comonad.com/reader/2008/kan-extensions/comment-page-1/#comment-61215 The Comonad.Reader » Free Monads for Less (Part 2 of 3): Yoneda Fri, 24 Jun 2011 04:53:38 +0000 http://comonad.com/reader/2008/kan-extensions/#comment-61215 [...] covered it briefly in my initial article on Kan extensions, but the inestimable Dan Piponi wrote a much nicer article on how it implies in Haskell that given [...] [...] covered it briefly in my initial article on Kan extensions, but the inestimable Dan Piponi wrote a much nicer article on how it implies in Haskell that given [...]

]]>
By: The Comonad.Reader » Free Monads for Less (Part 1 of 3): Codensity http://comonad.com/reader/2008/kan-extensions/comment-page-1/#comment-61208 The Comonad.Reader » Free Monads for Less (Part 1 of 3): Codensity Fri, 24 Jun 2011 04:00:16 +0000 http://comonad.com/reader/2008/kan-extensions/#comment-61208 [...] will arise in a subsequent post) on this blog previously, in a series of posts on Kan Extensions. [ 1, 2, [...] [...] will arise in a subsequent post) on this blog previously, in a series of posts on Kan Extensions. [ 1, 2, [...]

]]>
By: The Comonad.Reader » Kan Extensions III: As Ends and Coends http://comonad.com/reader/2008/kan-extensions/comment-page-1/#comment-1475 The Comonad.Reader » Kan Extensions III: As Ends and Coends Tue, 27 May 2008 00:22:20 +0000 http://comonad.com/reader/2008/kan-extensions/#comment-1475 [...] Grant B. asked me to post the derivation for the right and left Kan extension formula used in previous Kan Extension posts (1,2). For that we can turn to the definition of Kan extensions in terms of ends, but first we need to take a couple of steps back to find a way to represent (co)ends in Haskell. [...] [...] Grant B. asked me to post the derivation for the right and left Kan extension formula used in previous Kan Extension posts (1,2). For that we can turn to the definition of Kan extensions in terms of ends, but first we need to take a couple of steps back to find a way to represent (co)ends in Haskell. [...]

]]>
By: Edward Kmett http://comonad.com/reader/2008/kan-extensions/comment-page-1/#comment-1419 Edward Kmett Fri, 23 May 2008 05:33:57 +0000 http://comonad.com/reader/2008/kan-extensions/#comment-1419 The left Kan extension used in that paper is taken along a functor with domain |Hask| rather than Hask. Where |C| maps a category to its underlying discrete category, discarding all non-identity arrows. Their Lan only needs to support this discrete category, because that is all that is necessary to faithfully model GADTs. They don't need it since their only arrows are the identities. Since they only need concern themselves with identities, an equality GADT serves them in better stead. This is also why their definition of an HFunctor drops ffmap. It eases their derivation. For instance in http://comonad.com/haskell/category-extras/src/Control/Functor/HigherOrder/Composition.hs I have to deal with a lot of newtype noise to implement ffmap, since they don't need it at all, they don't have to cram that into the paper. If you look at Johann and Ghani's earlier paper "Initial Semantics is Enough!" at http://crab.rutgers.edu/~pjohann/tlca07-rev.pdf you'll find the exact definition above (modulo the choice of newtyping a tuple vs. using a data type. As for the derivations I was planning to do a post on that at some point, but the short answer is they are based on the definition of Kan extensions as (co)ends, which can be found readily in the Wikipedia article on Kan extensions or more formally in Categories for the Working Mathematician. The left Kan extension used in that paper is taken along a functor with domain |Hask| rather than Hask. Where |C| maps a category to its underlying discrete category, discarding all non-identity arrows. Their Lan only needs to support this discrete category, because that is all that is necessary to faithfully model GADTs.

They don’t need it since their only arrows are the identities. Since they only need concern themselves with identities, an equality GADT serves them in better stead.

This is also why their definition of an HFunctor drops ffmap. It eases their derivation. For instance in http://comonad.com/haskell/category-extras/src/Control/Functor/HigherOrder/Composition.hs

I have to deal with a lot of newtype noise to implement ffmap, since they don’t need it at all, they don’t have to cram that into the paper.

If you look at Johann and Ghani’s earlier paper “Initial Semantics is Enough!” at http://crab.rutgers.edu/~pjohann/tlca07-rev.pdf you’ll find the exact definition above (modulo the choice of newtyping a tuple vs. using a data type.

As for the derivations I was planning to do a post on that at some point, but the short answer is they are based on the definition of Kan extensions as (co)ends, which can be found readily in the Wikipedia article on Kan extensions or more formally in Categories for the Working Mathematician.

]]>
By: The Comonad.Reader » Kan Extensions II: Adjunctions, Composition, Lifting http://comonad.com/reader/2008/kan-extensions/comment-page-1/#comment-1415 The Comonad.Reader » Kan Extensions II: Adjunctions, Composition, Lifting Fri, 23 May 2008 00:13:23 +0000 http://comonad.com/reader/2008/kan-extensions/#comment-1415 [...] But first, I want to take a moment to recall adjunctions and show how they relate to some standard (co)monads, before tying them back to Kan extensions. [...] [...] But first, I want to take a moment to recall adjunctions and show how they relate to some standard (co)monads, before tying them back to Kan extensions. [...]

]]>
By: Grant B http://comonad.com/reader/2008/kan-extensions/comment-page-1/#comment-1412 Grant B Thu, 22 May 2008 22:01:04 +0000 http://comonad.com/reader/2008/kan-extensions/#comment-1412 Neat! One question: can you explain how you converted the definition of the Kan extension and its universal property into the Haskell datatype above? It should be unambiguous, correct? I'm confused as to why Johann and Ghani's GADT paper in POPL 2008 <a href="http://crab.rutgers.edu/~pjohann/popl08.pdf" rel="nofollow">here</a> gives a different encoding of the left Kan extension. Any help would be appreciated. Neat!

One question: can you explain how you converted the definition of the Kan extension and its universal property into the Haskell datatype above?

It should be unambiguous, correct? I’m confused as to why Johann and Ghani’s GADT paper in POPL 2008 here gives a different encoding of the left Kan extension.

Any help would be appreciated.

]]>