| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Proarrow.Category.Enriched.Finitary
Description
Profunctors whose hom-sets are finite and numbered: p a b is in bijection with an initial
segment of the naturals. This makes limits and colimits computable: an element is an index, so a
subset or quotient of a hom-set is a table of indices, which can be reified into a fresh object.
The numbering is a value, as in Proarrow.Category.Instance.FinHask. A type-level size could only be a formula in the sizes it is built from, which rules out constructions whose count depends on how arrows compose, such as the exponential and the subobject classifier.
A DecidableProfunctor is the special case where every size is
zero or one; decidableSize and decidableFromIndex build that instance.
This module is only the vocabulary. The category
and everything computed in it live in Proarrow.Category.Enriched.Finitary.Topos. The class
and FINITARY j kElt are needed by Powered, Proarrow.Category.Enriched and
others that the topos half itself depends on.
Synopsis
- class Profunctor p => Finitary (p :: j +-> k) where
- indices :: Natural -> [Natural]
- sizes :: forall {j} {k} (p :: j +-> k). (Finitary p, Enumerable j, Enumerable k) => [Natural]
- objIndex :: forall {k} (a :: k). (Enumerable k, Ob a) => Natural
- foreachOb :: Enumerable k => (forall (a :: k). Ob a => [r]) -> [r]
- decidableSize :: forall {j} {k} (p :: j +-> k) (a :: k) (b :: j). (DecidableProfunctor p, Ob a, Ob b) => Natural
- decidableFromIndex :: forall {j} {k} p (a :: k) (b :: j). (DecidableProfunctor p, Ob a, Ob b) => Natural -> p a b
- newtype Elt (p :: j +-> k) (a :: k) (b :: j) = Elt {
- unElt :: p a b
- class (CategoryOf k, Finitary (Hom k)) => LocallyFinite k
- factorThrough :: forall {k} (x :: k) (y :: k) (a :: k). (LocallyFinite k, Ob x, Ob y, Ob a) => (x ~> a) -> (y ~> a) -> Maybe (x ~> y)
- factorsThrough :: forall {k} (x :: k) (y :: k) (a :: k). (LocallyFinite k, Ob x, Ob y, Ob a) => (x ~> a) -> (y ~> a) -> Bool
- class (Enumerable k, Finitary (Hom k)) => FiniteCat k
- finiteSize :: forall {j} {k} (p :: j +-> k) (a :: k) (b :: j). Finite (p a b) => Natural
- finiteToIndex :: forall {j} {k} p (a :: k) (b :: j). (Finite (p a b), Eq (p a b)) => p a b -> Natural
- finiteFromIndex :: forall {j} {k} p (a :: k) (b :: j). Finite (p a b) => Natural -> p a b
- pairIndex :: Natural -> Natural -> Natural -> Natural
- unpairIndex :: Natural -> Natural -> (Natural, Natural)
Documentation
class Profunctor p => Finitary (p :: j +-> k) where Source Github #
A profunctor with finite, numbered hom-sets. toIndex and fromIndex are inverse for indices
below size; fromIndex of anything else is an error, as is toIndex of an element that is not
one the instance can produce (which only an unlawfully built value can be).
An instance whose elements are found by searching should define elements and read size off
it, rather than let the default call fromIndex once per element and repeat the search each time.
Methods
size :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural Source Github #
How many elements the hom-set has.
toIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => p a b -> Natural Source Github #
Where an element sits in elements. Takes its objects like the others do, so that an
instance that has to search can bind the search outside the argument lambda and a caller can
share it with let toIndexP = .toIndex @p @a @b
fromIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural -> p a b Source Github #
The element at a position.
elements :: forall (a :: k) (b :: j). (Ob a, Ob b) => [p a b] Source Github #
All elements of a hom-set, in index order.
Instances
| Finitary Booleans Source Github # |
|
Defined in Proarrow.Category.Enriched.Finitary Methods size :: forall (a :: BOOL) (b :: BOOL). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: BOOL) (b :: BOOL). (Ob a, Ob b) => Booleans a b -> Natural Source Github # fromIndex :: forall (a :: BOOL) (b :: BOOL). (Ob a, Ob b) => Natural -> Booleans a b Source Github # elements :: forall (a :: BOOL) (b :: BOOL). (Ob a, Ob b) => [Booleans a b] Source Github # | |
| Finitary FinHask Source Github # | The hom-sets of |
Defined in Proarrow.Category.Instance.FinHask Methods size :: forall (a :: FINHASK) (b :: FINHASK). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: FINHASK) (b :: FINHASK). (Ob a, Ob b) => FinHask a b -> Natural Source Github # fromIndex :: forall (a :: FINHASK) (b :: FINHASK). (Ob a, Ob b) => Natural -> FinHask a b Source Github # elements :: forall (a :: FINHASK) (b :: FINHASK). (Ob a, Ob b) => [FinHask a b] Source Github # | |
| Finitary Unit Source Github # | The one-object category has one arrow. |
Defined in Proarrow.Category.Enriched.Finitary Methods size :: forall (a :: ()) (b :: ()). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: ()) (b :: ()). (Ob a, Ob b) => Unit a b -> Natural Source Github # fromIndex :: forall (a :: ()) (b :: ()). (Ob a, Ob b) => Natural -> Unit a b Source Github # elements :: forall (a :: ()) (b :: ()). (Ob a, Ob b) => [Unit a b] Source Github # | |
| (CategoryOf j, CategoryOf k) => Finitary (InitialProfunctor :: k -> j -> Type) Source Github # | The initial profunctor has no elements anywhere. |
Defined in Proarrow.Category.Enriched.Finitary Methods size :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => InitialProfunctor a b -> Natural Source Github # fromIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural -> InitialProfunctor a b Source Github # elements :: forall (a :: k) (b :: j). (Ob a, Ob b) => [InitialProfunctor a b] Source Github # | |
| (FiniteCat j, FiniteCat k) => Finitary (Sieve :: k -> j -> Type) Source Github # | |
Defined in Proarrow.Category.Enriched.Finitary.Topos Methods size :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Sieve a b -> Natural Source Github # fromIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural -> Sieve a b Source Github # elements :: forall (a :: k) (b :: j). (Ob a, Ob b) => [Sieve a b] Source Github # | |
| (CategoryOf j, CategoryOf k) => Finitary (TerminalProfunctor :: k -> j -> Type) Source Github # | The terminal profunctor has one element everywhere. |
Defined in Proarrow.Category.Enriched.Finitary Methods size :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => TerminalProfunctor a b -> Natural Source Github # fromIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural -> TerminalProfunctor a b Source Github # elements :: forall (a :: k) (b :: j). (Ob a, Ob b) => [TerminalProfunctor a b] Source Github # | |
| (HasFiniteCovers t k, FiniteCat j, FiniteCat k) => Finitary (ClosedSieve t :: k -> j -> Type) Source Github # | |
Defined in Proarrow.Category.Enriched.Finitary.Sheaf Methods size :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => ClosedSieve t a b -> Natural Source Github # fromIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural -> ClosedSieve t a b Source Github # elements :: forall (a :: k) (b :: j). (Ob a, Ob b) => [ClosedSieve t a b] Source Github # | |
| (FunctorForRep f, LocallyFinite j) => Finitary (Corep f :: k -> j -> Type) Source Github # | A corepresentable over finite hom-sets is finitary, numbered as the hom-set |
Defined in Proarrow.Category.Enriched.Finitary Methods size :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Corep f a b -> Natural Source Github # fromIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural -> Corep f a b Source Github # elements :: forall (a :: k) (b :: j). (Ob a, Ob b) => [Corep f a b] Source Github # | |
| (HasFiniteCovers t k, Finitary p, FiniteCat j, FiniteCat k) => Finitary (Plus t p :: k -> j -> Type) Source Github # | Numbered by |
Defined in Proarrow.Category.Enriched.Finitary.Sheaf Methods size :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Plus t p a b -> Natural Source Github # fromIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural -> Plus t p a b Source Github # elements :: forall (a :: k) (b :: j). (Ob a, Ob b) => [Plus t p a b] Source Github # | |
| (Finitary p, Finitary q) => Finitary (p :+: q :: k -> j -> Type) Source Github # | The indices of |
Defined in Proarrow.Category.Enriched.Finitary Methods size :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => (p :+: q) a b -> Natural Source Github # fromIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural -> (p :+: q) a b Source Github # elements :: forall (a :: k) (b :: j). (Ob a, Ob b) => [(p :+: q) a b] Source Github # | |
| (Finitary p, Finitary q, FiniteCat j, FiniteCat k) => Finitary (p :~>: q :: k -> j -> Type) Source Github # | The internal hom of finitary profunctors is finitary: its elements are the natural
transformations out of |
Defined in Proarrow.Category.Enriched.Finitary.Topos Methods size :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => (p :~>: q) a b -> Natural Source Github # fromIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural -> (p :~>: q) a b Source Github # elements :: forall (a :: k) (b :: j). (Ob a, Ob b) => [(p :~>: q) a b] Source Github # | |
| (Finitary p, Finitary q) => Finitary (p :*: q :: k -> j -> Type) Source Github # | |
Defined in Proarrow.Category.Enriched.Finitary Methods size :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => (p :*: q) a b -> Natural Source Github # fromIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural -> (p :*: q) a b Source Github # elements :: forall (a :: k) (b :: j). (Ob a, Ob b) => [(p :*: q) a b] Source Github # | |
| (FiniteCat j, FiniteCat k, Ob a, Ob b) => Finitary (Yo a ('OP b) :: k -> j -> Type) Source Github # | The embedding is finitary when the arrows are: its elements over |
Defined in Proarrow.Profunctor.Instance.Yoneda Methods size :: forall (a0 :: k) (b0 :: j). (Ob a0, Ob b0) => Natural Source Github # toIndex :: forall (a0 :: k) (b0 :: j). (Ob a0, Ob b0) => Yo a ('OP b) a0 b0 -> Natural Source Github # fromIndex :: forall (a0 :: k) (b0 :: j). (Ob a0, Ob b0) => Natural -> Yo a ('OP b) a0 b0 Source Github # elements :: forall (a0 :: k) (b0 :: j). (Ob a0, Ob b0) => [Yo a ('OP b) a0 b0] Source Github # | |
| (Finitary w, Finitary s, FiniteCat j) => Finitary (w :.: s :: k -> i -> Type) Source Github # | The composite of finitary profunctors over a finite middle category is finitary. An element
at |
Defined in Proarrow.Category.Enriched.Finitary.Topos Methods size :: forall (a :: k) (b :: i). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: k) (b :: i). (Ob a, Ob b) => (w :.: s) a b -> Natural Source Github # fromIndex :: forall (a :: k) (b :: i). (Ob a, Ob b) => Natural -> (w :.: s) a b Source Github # elements :: forall (a :: k) (b :: i). (Ob a, Ob b) => [(w :.: s) a b] Source Github # | |
| (Finitary p, Enumerable j, Enumerable k, KnownTable (Objects j) (Objects k) fs) => Finitary (Reindex r p fs :: k -> j -> Type) Source Github # | |
Defined in Proarrow.Category.Enriched.Finitary.Topos Methods size :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Reindex r p fs a b -> Natural Source Github # fromIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural -> Reindex r p fs a b Source Github # elements :: forall (a :: k) (b :: j). (Ob a, Ob b) => [Reindex r p fs a b] Source Github # | |
| (FiniteCat j, FiniteCat k, KnownTables j k lm rm) => Finitary (Tabulated t lm rm :: k -> j -> Type) Source Github # | The numbering is the value. |
Defined in Proarrow.Category.Enriched.Finitary.Topos Methods size :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Tabulated t lm rm a b -> Natural Source Github # fromIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural -> Tabulated t lm rm a b Source Github # elements :: forall (a :: k) (b :: j). (Ob a, Ob b) => [Tabulated t lm rm a b] Source Github # | |
| (Finitary v, Finitary p, FiniteCat i, FiniteCat k) => Finitary (Ran ('OP v) p :: k -> j -> Type) Source Github # | The right Kan extension of finitary profunctors is finitary. It is the right Kan lift in the
opposite categories, |
Defined in Proarrow.Category.Enriched.Finitary.Topos Methods size :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Ran ('OP v) p a b -> Natural Source Github # fromIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural -> Ran ('OP v) p a b Source Github # elements :: forall (a :: k) (b :: j). (Ob a, Ob b) => [Ran ('OP v) p a b] Source Github # | |
| (Finitary w, Finitary p, FiniteCat i, FiniteCat j) => Finitary (Rift ('OP w) p :: k -> j -> Type) Source Github # | The right Kan lift of finitary profunctors is finitary: its elements are the natural
transformations out of |
Defined in Proarrow.Category.Enriched.Finitary.Topos Methods size :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Rift ('OP w) p a b -> Natural Source Github # fromIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural -> Rift ('OP w) p a b Source Github # elements :: forall (a :: k) (b :: j). (Ob a, Ob b) => [Rift ('OP w) p a b] Source Github # | |
| (Finitary w, LocallyFinite j, Ob a, Ob b) => Finitary (RiftWeight w a b :: k2 -> j -> Type) Source Github # | |
Defined in Proarrow.Category.Enriched.Finitary.Topos Methods size :: forall (a0 :: k2) (b0 :: j). (Ob a0, Ob b0) => Natural Source Github # toIndex :: forall (a0 :: k2) (b0 :: j). (Ob a0, Ob b0) => RiftWeight w a b a0 b0 -> Natural Source Github # fromIndex :: forall (a0 :: k2) (b0 :: j). (Ob a0, Ob b0) => Natural -> RiftWeight w a b a0 b0 Source Github # elements :: forall (a0 :: k2) (b0 :: j). (Ob a0, Ob b0) => [RiftWeight w a b a0 b0] Source Github # | |
| Finitary (LTE :: ORDINAL n -> ORDINAL n -> Type) Source Github # | The ordinals are thin too, so the same three lines serve. So a chain can be used as a site: a cover there can have a leg that is itself covered, which no coverage on a two-object category can arrange. |
Defined in Proarrow.Category.Enriched.Finitary Methods size :: forall (a :: ORDINAL n) (b :: ORDINAL n). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: ORDINAL n) (b :: ORDINAL n). (Ob a, Ob b) => LTE a b -> Natural Source Github # fromIndex :: forall (a :: ORDINAL n) (b :: ORDINAL n). (Ob a, Ob b) => Natural -> LTE a b Source Github # elements :: forall (a :: ORDINAL n) (b :: ORDINAL n). (Ob a, Ob b) => [LTE a b] Source Github # | |
| Finitary p => Finitary (Op p :: OPPOSITE j -> OPPOSITE k -> Type) Source Github # | The opposite of a finitary profunctor is finitary, at the same sizes read the other way round.
Taking |
Defined in Proarrow.Category.Enriched.Finitary Methods size :: forall (a :: OPPOSITE j) (b :: OPPOSITE k). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: OPPOSITE j) (b :: OPPOSITE k). (Ob a, Ob b) => Op p a b -> Natural Source Github # fromIndex :: forall (a :: OPPOSITE j) (b :: OPPOSITE k). (Ob a, Ob b) => Natural -> Op p a b Source Github # elements :: forall (a :: OPPOSITE j) (b :: OPPOSITE k). (Ob a, Ob b) => [Op p a b] Source Github # | |
| (InternalIn ik FINSET, SNatI (NumObs ik)) => Finitary (Internal :: INTERNAL ik -> INTERNAL ik -> Type) Source Github # | |
Defined in Proarrow.Category.Internal Methods size :: forall (a :: INTERNAL ik) (b :: INTERNAL ik). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: INTERNAL ik) (b :: INTERNAL ik). (Ob a, Ob b) => Internal a b -> Natural Source Github # fromIndex :: forall (a :: INTERNAL ik) (b :: INTERNAL ik). (Ob a, Ob b) => Natural -> Internal a b Source Github # elements :: forall (a :: INTERNAL ik) (b :: INTERNAL ik). (Ob a, Ob b) => [Internal a b] Source Github # | |
| (FiniteCat j, FiniteCat k, forall (p :: j +-> k). ob p => SubFinitary p) => Finitary (Sub (Prof :: (j +-> k) -> (j +-> k) -> Type) :: SUBCAT ob -> SUBCAT ob -> Type) Source Github # |
The same holds for any full subcategory whose predicate implies |
Defined in Proarrow.Category.Enriched.Finitary.Topos Methods size :: forall (a :: SUBCAT ob) (b :: SUBCAT ob). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: SUBCAT ob) (b :: SUBCAT ob). (Ob a, Ob b) => Sub (Prof :: (j +-> k) -> (j +-> k) -> Type) a b -> Natural Source Github # fromIndex :: forall (a :: SUBCAT ob) (b :: SUBCAT ob). (Ob a, Ob b) => Natural -> Sub (Prof :: (j +-> k) -> (j +-> k) -> Type) a b Source Github # elements :: forall (a :: SUBCAT ob) (b :: SUBCAT ob). (Ob a, Ob b) => [Sub (Prof :: (j +-> k) -> (j +-> k) -> Type) a b] Source Github # | |
| (Finitary p, Finitary q) => Finitary (p :**: q :: (k1, k2) -> (j1, j2) -> Type) Source Github # | The product of two finitary profunctors on the product of their kinds, numbered as |
Defined in Proarrow.Category.Enriched.Finitary Methods size :: forall (a :: (k1, k2)) (b :: (j1, j2)). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: (k1, k2)) (b :: (j1, j2)). (Ob a, Ob b) => (p :**: q) a b -> Natural Source Github # fromIndex :: forall (a :: (k1, k2)) (b :: (j1, j2)). (Ob a, Ob b) => Natural -> (p :**: q) a b Source Github # elements :: forall (a :: (k1, k2)) (b :: (j1, j2)). (Ob a, Ob b) => [(p :**: q) a b] Source Github # | |
| (Finitary (Hom j), Finitary (Hom k), Finitary p) => Finitary (Collage :: COLLAGE p -> COLLAGE p -> Type) Source Github # | The collage of a finitary profunctor between finite categories is a finite category: a
hom-set is a base hom-set, an element set of This is the cheapest source of a finite category that is not a poset: elements of |
Defined in Proarrow.Category.Instance.Collage Methods size :: forall (a :: COLLAGE p) (b :: COLLAGE p). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: COLLAGE p) (b :: COLLAGE p). (Ob a, Ob b) => Collage a b -> Natural Source Github # fromIndex :: forall (a :: COLLAGE p) (b :: COLLAGE p). (Ob a, Ob b) => Natural -> Collage a b Source Github # elements :: forall (a :: COLLAGE p) (b :: COLLAGE p). (Ob a, Ob b) => [Collage a b] Source Github # | |
indices :: Natural -> [Natural] Source Github #
[0 .. n-1], which n being a Natural rules out writing directly.
sizes :: forall {j} {k} (p :: j +-> k). (Finitary p, Enumerable j, Enumerable k) => [Natural] Source Github #
A finitary profunctor's hom-set sizes, one per pair of objects, the outer index running over
k and the inner over j. Cheap enough to display an object by: a presheaf on the graph
schema, say, shows as [2,4,2,4].
objIndex :: forall {k} (a :: k). (Enumerable k, Ob a) => Natural Source Github #
The position of an object in its kind's object list.
foreachOb :: Enumerable k => (forall (a :: k). Ob a => [r]) -> [r] Source Github #
Everything an enumeration of a kind's objects can do at each of them, concatenated.
Thin profunctors
decidableSize :: forall {j} {k} (p :: j +-> k) (a :: k) (b :: j). (DecidableProfunctor p, Ob a, Ob b) => Natural Source Github #
decidableFromIndex :: forall {j} {k} p (a :: k) (b :: j). (DecidableProfunctor p, Ob a, Ob b) => Natural -> p a b Source Github #
Hom-sets as finite sets
newtype Elt (p :: j +-> k) (a :: k) (b :: j) Source Github #
An element of a hom-set of p, viewed as an element of a finite set: every instance the
universe package asks for is supplied by the numbering, with toIndex standing in for equality
and ordering. So a finitary profunctor is a profunctor enriched in
FINHASK.
Instances
| Finitary p => Show (Elt p a b) Source Github # | |
| Finitary p => Eq (Elt p a b) Source Github # | |
| Finitary p => Ord (Elt p a b) Source Github # | |
Defined in Proarrow.Category.Enriched.Finitary | |
| (Finitary p, Ob a, Ob b) => Finite (Elt p a b) Source Github # | |
| (Finitary p, Ob a, Ob b) => Universe (Elt p a b) Source Github # | |
Defined in Proarrow.Category.Enriched.Finitary | |
class (CategoryOf k, Finitary (Hom k)) => LocallyFinite k Source Github #
A category whose hom-sets are finite: the Finitary counterpart of
Decidable, and one half of FiniteCat.
Instances
| (CategoryOf k, Finitary (Hom k)) => LocallyFinite k Source Github # | |
Defined in Proarrow.Category.Enriched.Finitary | |
factorThrough :: forall {k} (x :: k) (y :: k) (a :: k). (LocallyFinite k, Ob x, Ob y, Ob a) => (x ~> a) -> (y ~> a) -> Maybe (x ~> y) Source Github #
How an arrow factors through another into the same object: is an factorThrough g fh
with g = f , if there is one. Only the hom-set . hx is searched, so only the
hom-sets need to be finite. An element is in the image of ~> yf iff it factors through f.
factorsThrough :: forall {k} (x :: k) (y :: k) (a :: k). (LocallyFinite k, Ob x, Ob y, Ob a) => (x ~> a) -> (y ~> a) -> Bool Source Github #
Whether an arrow factors through another, which is factorThrough with the witness dropped.
generatedSieve is the caller: a cover's sieve is the
arrows that factor through one of its legs.
class (Enumerable k, Finitary (Hom k)) => FiniteCat k Source Github #
A finite category: finitely many objects, and finitely many arrows between them. The first is
Enumerable, the second does not follow from it, and the enumeration below needs both.
Instances
| (Enumerable k, Finitary (Hom k)) => FiniteCat k Source Github # | |
Defined in Proarrow.Category.Enriched.Finitary | |
finiteSize :: forall {j} {k} (p :: j +-> k) (a :: k) (b :: j). Finite (p a b) => Natural Source Github #
A profunctor between categories with finite hom-sets is finitary iff it is enriched in finite
sets. These build a Finitary instance from Finite hom-sets, the counterparts of
decidableSize and decidableFromIndex one level up.
finiteToIndex and finiteFromIndex search universeF, which is fine for small hom-sets.
For large ones compute the index arithmetically, as
FinHask does.
finiteToIndex :: forall {j} {k} p (a :: k) (b :: j). (Finite (p a b), Eq (p a b)) => p a b -> Natural Source Github #
finiteFromIndex :: forall {j} {k} p (a :: k) (b :: j). Finite (p a b) => Natural -> p a b Source Github #
Products and coproducts
pairIndex :: Natural -> Natural -> Natural -> Natural Source Github #
A pair of indices as one index, row-major: the first factor varies slowest. Shared by the two
instances that number a pair of independent choices (the product profunctor and the Yoneda
embedding), because ExpWeight nests one inside the other, so they have to agree.