Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Representable (Lan f g) #80

Open
Icelandjack opened this issue Feb 27, 2024 · 2 comments
Open

Representable (Lan f g) #80

Icelandjack opened this issue Feb 27, 2024 · 2 comments

Comments

@Icelandjack
Copy link
Contributor

Icelandjack commented Feb 27, 2024

I spotted this on ncatlab

Proposition 4.1. For F:Cβ†’D a 𝒱-enriched functor between small 𝒱-enriched categories we have

  1. the left Kan extension along F takes representable presheaves C(c,βˆ’):C→𝒱 to their image under F:
Lan FC(c,βˆ’)≃D(F(c),βˆ’)

for all c ∈ C.

An in Haskell this translates (roughly) to a Representableinstance for Lan:

instance (Functor f, Representable g) => Distributive (Lan f g) where
  distribute :: Functor h => h (Lan f g a) -> Lan f g (h a)
  distribute = distributeRep

instance (Functor f, Representable g) => Representable (Lan f g) where
  type Rep (Lan f g) = f (Rep g)

  index :: Lan f g a -> (f (Rep g) -> a)
  index (Lan f g) = f . fmap (index g)

  tabulate :: (f (Rep g) -> a) -> Lan f g a
  tabulate = (`Lan` tabulate id)

I noticed it was missing from the library.

@RyanGlScott
Copy link
Collaborator

Those feel like reasonable additions to the library.

Out of curiosity, does the Distributive instance need a full Representable g constraint? Or would Distributive g suffice, assuming that you rewrote the implementation accordingly?

@Icelandjack
Copy link
Contributor Author

No I wasn't able to come up with it but I fully expect that the constraint can be weakened. I also wasn't able to determine if a dual case exists for Ran.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants