// TODO Haskell extends Distrivutive, Scalaz require F to be Functor
trait Representable[F[_], Rep] {
def tabulate[X](f: Rep => X): F[X]
def index[X](fx: F[X])(f: Rep): X
}
-
Implementations: Scalaz 7, Cats, Haskell, Agda, UniMath, nLab
-
Resources:
- (Haskell) Representing Applicatives - Gershom Bazerman (blog post)
- (Category Theory, Haskell) Representable Functors - Bartosz Milewski (blog post)
- (Category Theory, Haskell) Category Theory II 4.1: Representable Functors - Bartosz Milewski (video) Scala code translation
- (Haskell) Zippers Using Representable And Cofree - Chris Penner (blog post):
- (Haskell) Radix Sort, Trie Trees, And Maps From Representable Functors - Chris Penner (blog post)
- (Haskell) Monad.Representable.Reader, Monad.Representable.State, Comonad.Representable.Store
- Moore for Less - Edward Kmett (blog post)
- Representable Functors - Danny Gratzer (blog post)
- Which Haskell Functors are equivalent to the Reader functor - pigworker SO
- Representable Functor isomorphic to (Bool -> a) SO
- masaeedu/representable (different formulation of Representable functors that carries the domain around)
- usage of Representable in old hanshoglund/music-suite
- Java Mojang/DataFixerUpper Representable
- Implementations: Haskell
Adjunction[F,B] spacify relation between two Functors (There is natural transformation between composition of those two functors and identity.) We say that F is left adjoint to G.
trait Adjunction[F[_], G[_]] {
def left[A, B](f: F[A] => B): A => G[B]
def right[A, B](f: A => G[B]): F[A] => B
}
Adjunction can be defined between Reader monad and Coreader comonad.
- Resources:
- Adjunctions And Battleship - Chris Penner (blog post)
- Scala Comonad Tutorial, Part 2 - Rúnar Bjarnason (blog post)
- Adjunctions in Everyday Life - Rúnar Bjarnason (video Scala) (video Haskell)
- Scalaz docs
- Haskell libraries using Adjunctions
- usage in ekmett/representable-tries
- (Haskell) Representing Adjunctions - Edward Kmett (blog post)
- (Haskell) Zapping Adjunctions - Edward Kmett (blog post)
- Adjunctions - TheCatsters (vide playlist)
- State monad using Adjunctions kaifransson/adjoint-stacks
- (Haskell) Free And Forgetful Functors - Chris Penner (blog post)
- Adjunctions - M.M. Fokkinga, Lambert Meertens
- Generic Programming with Adjunctions - Ralf Hinze
- Relational Algebra by Way of Adjunctions - Jeremy Gibbons, Fritz, Henglein, Ralf Hinze, Nicolas Wu
- (Haskell) Monad.Trans.Adjoint, Comonad.Trans.Adjoint, Monad.Trans.Contravariant.Adjoint
- (Haskell) SO - Monads as adjunctions
- (Haskell) SO - Which common monads arise from adjunctions in Hask?
- (Haskell) SO - How to Factorize Continuation Monad into Left & Right Adjoints?
- (Haskell) SO - What are the adjoint functor pairs corresponding to common monads in Haskell?
- (Unison) Adjunction used as template of types
- Adjunction for Garbage Collection with Application to Graph Rewriting - D. Duval, R. Echahed, F. Prost
- Resources:
- (Haskell) Adjoint Triples - Dan Doel (blog post)
- (Haskell) adjunctions/Control.Comonad.Trans.Adjoint
- Adjoint functors and triples - Samuel Eilenberg and John C. Moore
- Fancy Algebra (Graduate Topics Course) - Drew Armstrong
- nLab adjoint triple