moonlight-category 1.0.0.0 → 1.1.0.0
raw patch · 23 files changed
+729/−201 lines, 23 filesdep ~basedep ~moonlight-palePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, moonlight-pale
API changes (from Hackage documentation)
- Moonlight.Category.Presentation: infixr 9 `after`
+ Moonlight.Category: ComposableChainCategoryError :: CategoryError c -> ComposableChainError c
+ Moonlight.Category: ComposableChainEndpointMismatch :: Ob c -> Ob c -> ComposableChainError c
+ Moonlight.Category: CompositionResult :: ir -> [obligation] -> decoration -> CompositionResult ir obligation decoration
+ Moonlight.Category: CoverNotClosed :: obj -> obj -> Set obj -> SiteViolation obj
+ Moonlight.Category: CoverOutsideReachable :: obj -> Set obj -> SiteViolation obj
+ Moonlight.Category: DecoratedCompositionLeftBoundaryMissing :: DecoratedCompositionError category
+ Moonlight.Category: DecoratedCompositionRightBoundaryMissing :: DecoratedCompositionError category
+ Moonlight.Category: DecoratedCompositionStructuredError :: StructuredCospanError category -> DecoratedCompositionError category
+ Moonlight.Category: FinThinFunctorMissingSourceObject :: FinObjectId -> FinThinFunctorValidationError
+ Moonlight.Category: FinThinFunctorOrderNotPreserved :: FinObjectId -> FinObjectId -> FinObjectId -> FinObjectId -> FinThinFunctorValidationError
+ Moonlight.Category: FinThinFunctorSourceNotThin :: FinThinFunctorValidationError
+ Moonlight.Category: FinThinFunctorTargetNotThin :: FinThinFunctorValidationError
+ Moonlight.Category: FinThinFunctorTargetObjectAbsent :: FinObjectId -> FinObjectId -> FinThinFunctorValidationError
+ Moonlight.Category: FinThinFunctorUnexpectedSourceObject :: FinObjectId -> FinThinFunctorValidationError
+ Moonlight.Category: FinThinFunctorUnknownSourceObject :: FinObjectId -> FinThinFunctorApplicationError
+ Moonlight.Category: ImportCycleDetected :: NonEmpty obj -> SiteViolation obj
+ Moonlight.Category: ImportsValidated :: ThinSiteValidation
+ Moonlight.Category: MissingCover :: obj -> SiteViolation obj
+ Moonlight.Category: MonicMatchComponents :: Mor c -> MonicMatchComponents c
+ Moonlight.Category: PBPOComplementComponents :: Ob c -> Mor c -> Mor c -> Ob c -> Mor c -> Mor c -> Mor c -> Mor c -> PBPOComplementComponents c
+ Moonlight.Category: PresentationGlue :: boundary -> DecoratedPresentation boundary ir decoration -> DecoratedPresentation boundary ir decoration -> DecoratedPresentation boundary ir decoration
+ Moonlight.Category: PresentationLeaf :: ir -> decoration -> DecoratedPresentation boundary ir decoration
+ Moonlight.Category: PushoutComplementComponents :: Ob c -> Mor c -> Mor c -> PushoutComplementComponents c
+ Moonlight.Category: QuotientCodomainMorphismInvalid :: SitePathQuotientError obj
+ Moonlight.Category: QuotientCodomainMorphismMissing :: FinMorphismId -> SitePathQuotientError obj
+ Moonlight.Category: QuotientCodomainObjectMissing :: FinObjectId -> SitePathQuotientError obj
+ Moonlight.Category: QuotientMorphismWrongDomain :: SitePathQuotientError obj
+ Moonlight.Category: QuotientObjectWrongDomain :: SitePathQuotientError obj
+ Moonlight.Category: QuotientUnknownMorphismPair :: obj -> obj -> SitePathQuotientError obj
+ Moonlight.Category: QuotientUnknownObject :: obj -> SitePathQuotientError obj
+ Moonlight.Category: SiteManifest :: Set obj -> Map obj (Set obj) -> Map obj (Set obj) -> SiteManifest obj
+ Moonlight.Category: SiteManifestInvalid :: NonEmpty (SiteViolation obj) -> SiteFinCatError obj
+ Moonlight.Category: SiteValidated :: ThinSiteValidation
+ Moonlight.Category: StructuredCompositionAlgebra :: (boundary -> (ir, decoration) -> Maybe (StructuredCospan category decoration)) -> (boundary -> (ir, decoration) -> (ir, decoration) -> StructuredCospan category decoration -> (ir, [obligation])) -> StructuredCompositionAlgebra boundary category ir decoration obligation
+ Moonlight.Category: StructuredCospanBoundaryMismatch :: Ob category -> Ob category -> StructuredCospanError category
+ Moonlight.Category: StructuredCospanCategoryError :: CategoryError category -> StructuredCospanError category
+ Moonlight.Category: StructuredCospanPushoutMissing :: Mor category -> Mor category -> StructuredCospanError category
+ Moonlight.Category: ThinSiteCodomainMorphismInvalid :: FinCatError -> ThinSiteLookupError obj
+ Moonlight.Category: ThinSiteCodomainMorphismMissing :: FinMorphismId -> ThinSiteLookupError obj
+ Moonlight.Category: ThinSiteCodomainObjectMissing :: FinObjectId -> ThinSiteLookupError obj
+ Moonlight.Category: ThinSiteForeignCodomainObject :: FinCatHandle -> FinCatHandle -> FinObjectId -> ThinSiteObjectValueError
+ Moonlight.Category: ThinSiteUnknownMorphismPair :: obj -> obj -> ThinSiteLookupError obj
+ Moonlight.Category: ThinSiteUnknownObject :: obj -> ThinSiteLookupError obj
+ Moonlight.Category: ThinSiteUnmappedCodomainObject :: FinObjectId -> ThinSiteObjectValueError
+ Moonlight.Category: UnknownCoverTarget :: obj -> SiteViolation obj
+ Moonlight.Category: UnknownCoveredObject :: obj -> obj -> SiteViolation obj
+ Moonlight.Category: UnknownImportTarget :: obj -> SiteViolation obj
+ Moonlight.Category: UnknownImportedObject :: obj -> obj -> SiteViolation obj
+ Moonlight.Category: [Dict] :: forall c. c => Dict c
+ Moonlight.Category: [Exists] :: forall {k} (w :: k -> Type) (member :: k). w member -> Exists w
+ Moonlight.Category: [composedDecoration] :: CompositionResult ir obligation decoration -> decoration
+ Moonlight.Category: [composedIR] :: CompositionResult ir obligation decoration -> ir
+ Moonlight.Category: [composedObligations] :: CompositionResult ir obligation decoration -> [obligation]
+ Moonlight.Category: [fromStructuredComposition] :: StructuredCompositionAlgebra boundary category ir decoration obligation -> boundary -> (ir, decoration) -> (ir, decoration) -> StructuredCospan category decoration -> (ir, [obligation])
+ Moonlight.Category: [monicMatchComponentArrow] :: MonicMatchComponents c -> Mor c
+ Moonlight.Category: [pbpoComplementComponentBorrowedLeg] :: PBPOComplementComponents c -> Mor c
+ Moonlight.Category: [pbpoComplementComponentPullbackObject] :: PBPOComplementComponents c -> Ob c
+ Moonlight.Category: [pbpoComplementComponentPullbackToBorrowed] :: PBPOComplementComponents c -> Mor c
+ Moonlight.Category: [pbpoComplementComponentPullbackToMatch] :: PBPOComplementComponents c -> Mor c
+ Moonlight.Category: [pbpoComplementComponentPushoutFromComplement] :: PBPOComplementComponents c -> Mor c
+ Moonlight.Category: [pbpoComplementComponentPushoutFromMatch] :: PBPOComplementComponents c -> Mor c
+ Moonlight.Category: [pbpoComplementComponentPushoutObject] :: PBPOComplementComponents c -> Ob c
+ Moonlight.Category: [pbpoComplementComponentResidualLeg] :: PBPOComplementComponents c -> Mor c
+ Moonlight.Category: [pushoutComplementComponentBorrowedLeg] :: PushoutComplementComponents c -> Mor c
+ Moonlight.Category: [pushoutComplementComponentObject] :: PushoutComplementComponents c -> Ob c
+ Moonlight.Category: [pushoutComplementComponentResidualLeg] :: PushoutComplementComponents c -> Mor c
+ Moonlight.Category: [siteCovers] :: SiteManifest obj -> Map obj (Set obj)
+ Moonlight.Category: [siteImports] :: SiteManifest obj -> Map obj (Set obj)
+ Moonlight.Category: [siteObjects] :: SiteManifest obj -> Set obj
+ Moonlight.Category: [toStructuredBoundary] :: StructuredCompositionAlgebra boundary category ir decoration obligation -> boundary -> (ir, decoration) -> Maybe (StructuredCospan category decoration)
+ Moonlight.Category: adjustCoveringProduct :: forall {k} w (member :: k) f. (forall (left :: k) (right :: k). () => w left -> w right -> Maybe (left :~: right)) -> w member -> (f member -> f member) -> CoveringProduct w f -> CoveringProduct w f
+ Moonlight.Category: allMembers :: CoveringFamily w => [Exists w]
+ Moonlight.Category: allPositions :: PolynomialFunctor polynomial => [Exists (Position polynomial)]
+ Moonlight.Category: alpha :: GaloisConnection a b => a -> b
+ Moonlight.Category: appendComposableMorphism :: (Category c, Eq (Ob c)) => c -> ComposableChain c -> Mor c -> Either (ComposableChainError c) (ComposableChain c)
+ Moonlight.Category: applyFinThinFunctor :: FinThinFunctor -> FinObjectId -> Either FinThinFunctorApplicationError FinObjectId
+ Moonlight.Category: associator :: Bicategory c => c -> Mor c -> Mor c -> Mor c -> Compositor c
+ Moonlight.Category: associatorV :: MonoidalCategory v => Ob v -> Ob v -> Ob v -> Compositor v
+ Moonlight.Category: automorphismGroupAt :: Ord (Ob c) => AutomorphismGroupoid c -> AutomorphismGroupoidObject c -> [AutomorphismGroupoidMorphism c]
+ Moonlight.Category: automorphismGroupoid :: (FiniteComposableCategory c, Ord (Ob c), Ord (Mor c)) => c -> AutomorphismGroupoid c
+ Moonlight.Category: automorphismGroupoidFromIndex :: Ord (Ob c) => c -> InvertibilityIndex c -> AutomorphismGroupoid c
+ Moonlight.Category: automorphismGroupoidObjects :: AutomorphismGroupoid c -> [AutomorphismGroupoidObject c]
+ Moonlight.Category: chainDimension :: ComposableChain c -> Natural
+ Moonlight.Category: chainMorphisms :: ComposableChain c -> [Mor c]
+ Moonlight.Category: chainStartObject :: ComposableChain c -> Ob c
+ Moonlight.Category: chainTerminalObject :: ComposableChain c -> Ob c
+ Moonlight.Category: chainVertices :: ComposableChain c -> NonEmpty (Ob c)
+ Moonlight.Category: chainsOfDimension :: FiniteComposableCategory c => c -> Natural -> [ComposableChain c]
+ Moonlight.Category: class (HasPushouts c, HasPullbacks c) => AdhesiveCategory c
+ Moonlight.Category: class HigherCategory c => Bicategory c
+ Moonlight.Category: class Category c where {
+ Moonlight.Category: class CoveringFamily w => CoveringConstraints (w :: k -> Type) (c :: k -> Constraint)
+ Moonlight.Category: class CoveringFamily (w :: k -> Type)
+ Moonlight.Category: class DoubleCategory object double | double -> object where {
+ Moonlight.Category: class (Category c, MonoidalCategory v) => EnrichedCategory c v | c -> v
+ Moonlight.Category: class (Category c, Eq Ob c) => FiniteComposableCategory c
+ Moonlight.Category: class (Ord a, Ord b) => GaloisConnection a b | a -> b, b -> a
+ Moonlight.Category: class Category c => HasCoequalizers c
+ Moonlight.Category: class Category c => HasCoproducts c where {
+ Moonlight.Category: class Category c => HasEqualizers c
+ Moonlight.Category: class Category c => HasProducts c where {
+ Moonlight.Category: class Category c => HasPullbacks c
+ Moonlight.Category: class Category c => HasPushouts c
+ Moonlight.Category: class Category c => HigherCategory c
+ Moonlight.Category: class Category v => MonoidalCategory v
+ Moonlight.Category: class GaloisConnection a b => OrdinalGalois a b
+ Moonlight.Category: class AdhesiveCategory c => PBPOAdhesiveCategory c
+ Moonlight.Category: class ParameterizedPolynomialFunctor polynomial where {
+ Moonlight.Category: class PolynomialFunctor polynomial where {
+ Moonlight.Category: class HigherCategory c => TwoCategory c
+ Moonlight.Category: coequalizer :: HasCoequalizers c => c -> Mor c -> Mor c -> Maybe (Ob c, Mor c)
+ Moonlight.Category: compileDecoratedPresentation :: (decoration -> decoration -> decoration) -> (boundary -> (ir, decoration) -> (ir, decoration) -> (ir, [obligation])) -> DecoratedPresentation boundary ir decoration -> CompositionResult ir obligation decoration
+ Moonlight.Category: compileDecoratedPresentationStructured :: (HasPushouts category, Eq (Ob category)) => category -> StructuredCompositionAlgebra boundary category ir decoration obligation -> (decoration -> decoration -> decoration) -> DecoratedPresentation boundary ir decoration -> Either (DecoratedCompositionError category) (CompositionResult ir obligation decoration)
+ Moonlight.Category: compose :: Category c => c -> Mor c -> Mor c -> Either (CategoryError c) (Mor c, Compositor c)
+ Moonlight.Category: composeDecorated :: (decoration -> decoration -> decoration) -> (boundary -> (ir, decoration) -> (ir, decoration) -> (ir, [obligation])) -> boundary -> (ir, decoration) -> (ir, decoration) -> CompositionResult ir obligation decoration
+ Moonlight.Category: composeDecoratedStructured :: (HasPushouts category, Eq (Ob category)) => category -> StructuredCompositionAlgebra boundary category ir decoration obligation -> (decoration -> decoration -> decoration) -> boundary -> (ir, decoration) -> (ir, decoration) -> Either (DecoratedCompositionError category) (CompositionResult ir obligation decoration)
+ Moonlight.Category: composeHorizontal :: forall (boundary :: object) (target :: object) (source :: object). DoubleCategory object double => HorizontalMor object double boundary target -> HorizontalMor object double source boundary -> Maybe (HorizontalMor object double source target)
+ Moonlight.Category: composeMor :: Category c => c -> Mor c -> Mor c -> Either (CategoryError c) (Mor c)
+ Moonlight.Category: composeSquaresHorizontal :: forall (middleNorth :: object) (eastNorth :: object) (middleSouth :: object) (eastSouth :: object) (westNorth :: object) (westSouth :: object). DoubleCategory object double => Square object double middleNorth eastNorth middleSouth eastSouth -> Square object double westNorth middleNorth westSouth middleSouth -> Maybe (Square object double westNorth eastNorth westSouth eastSouth)
+ Moonlight.Category: composeSquaresVertical :: forall (middleWest :: object) (middleEast :: object) (southWest :: object) (southEast :: object) (northWest :: object) (northEast :: object). DoubleCategory object double => Square object double middleWest middleEast southWest southEast -> Square object double northWest northEast middleWest middleEast -> Maybe (Square object double northWest northEast southWest southEast)
+ Moonlight.Category: composeStructuredCospan :: (HasPushouts category, Eq (Ob category)) => category -> (leftDecoration -> rightDecoration -> combinedDecoration) -> StructuredCospan category leftDecoration -> StructuredCospan category rightDecoration -> Either (StructuredCospanError category) (StructuredCospan category combinedDecoration)
+ Moonlight.Category: composeStructuredDecoratedCospan :: (HasPushouts category, Eq (Ob category)) => category -> (leftDecoration -> rightDecoration -> combinedDecoration) -> StructuredCospan category leftDecoration -> StructuredCospan category rightDecoration -> Either (StructuredCospanError category) (StructuredCospan category combinedDecoration)
+ Moonlight.Category: composeThinMorphismBy :: Eq obj => (obj -> obj -> Bool) -> ThinMorphism obj -> ThinMorphism obj -> Maybe (ThinMorphism obj)
+ Moonlight.Category: composeVertical :: forall (boundary :: object) (target :: object) (source :: object). DoubleCategory object double => VerticalMor object double boundary target -> VerticalMor object double source boundary -> Maybe (VerticalMor object double source target)
+ Moonlight.Category: compositor :: HigherCategory c => c -> Mor c -> Mor c -> Mor c -> Compositor c
+ Moonlight.Category: constraintDict :: forall (member :: k). CoveringConstraints w c => w member -> Dict (c member)
+ Moonlight.Category: coproductInj1 :: HasCoproducts c => c -> CoproductOb c -> Mor c
+ Moonlight.Category: coproductInj2 :: HasCoproducts c => c -> CoproductOb c -> Mor c
+ Moonlight.Category: coproductUniversal :: HasCoproducts c => c -> Mor c -> Mor c -> Mor c
+ Moonlight.Category: coreGroupoid :: (FiniteComposableCategory c, Ord (Ob c), Ord (Mor c)) => c -> CoreGroupoid c
+ Moonlight.Category: coreGroupoidFromIndex :: Ord (Ob c) => c -> InvertibilityIndex c -> CoreGroupoid c
+ Moonlight.Category: coreGroupoidMorphisms :: CoreGroupoid c -> [CoreGroupoidMorphism c]
+ Moonlight.Category: coreGroupoidMorphismsBetween :: Ord (Ob c) => CoreGroupoid c -> CoreGroupoidObject c -> CoreGroupoidObject c -> [CoreGroupoidMorphism c]
+ Moonlight.Category: coreGroupoidObjects :: CoreGroupoid c -> [CoreGroupoidObject c]
+ Moonlight.Category: data AutomorphismGroupoid c
+ Moonlight.Category: data AutomorphismGroupoidMorphism c
+ Moonlight.Category: data AutomorphismGroupoidObject c
+ Moonlight.Category: data ComposableChain c
+ Moonlight.Category: data ComposableChainError c
+ Moonlight.Category: data CompositionResult ir obligation decoration
+ Moonlight.Category: data CoreGroupoid c
+ Moonlight.Category: data CoreGroupoidMorphism c
+ Moonlight.Category: data CoreGroupoidObject c
+ Moonlight.Category: data CoveringProduct (w :: k -> Type) (f :: k -> Type)
+ Moonlight.Category: data DecoratedCompositionError category
+ Moonlight.Category: data DecoratedPresentation boundary ir decoration
+ Moonlight.Category: data DenseIntSet
+ Moonlight.Category: data Dict c
+ Moonlight.Category: data Exists (w :: k -> Type)
+ Moonlight.Category: data FinThinFunctor
+ Moonlight.Category: data FinThinFunctorApplicationError
+ Moonlight.Category: data FinThinFunctorValidationError
+ Moonlight.Category: data InvertibilityIndex c
+ Moonlight.Category: data MonicMatchComponents c
+ Moonlight.Category: data MonicMatchWitness c
+ Moonlight.Category: data PBPOComplementComponents c
+ Moonlight.Category: data PBPOComplementWitness c
+ Moonlight.Category: data ParameterizedPosition polynomial :: Type -> Type;
+ Moonlight.Category: data PathThinCat obj
+ Moonlight.Category: data PathThinMorphism obj
+ Moonlight.Category: data PathThinObject obj
+ Moonlight.Category: data Position polynomial :: Type -> Type;
+ Moonlight.Category: data PushoutComplementComponents c
+ Moonlight.Category: data PushoutComplementWitness c
+ Moonlight.Category: data SiteFinCatError obj
+ Moonlight.Category: data SiteManifest obj
+ Moonlight.Category: data SitePathCategory obj
+ Moonlight.Category: data SitePathMorphism obj
+ Moonlight.Category: data SitePathObject obj
+ Moonlight.Category: data SitePathQuotient obj
+ Moonlight.Category: data SitePathQuotientError obj
+ Moonlight.Category: data SiteViolation obj
+ Moonlight.Category: data SizedComposableChain c
+ Moonlight.Category: data StructuredCompositionAlgebra boundary category ir decoration obligation
+ Moonlight.Category: data StructuredCospan category decoration
+ Moonlight.Category: data StructuredCospanError category
+ Moonlight.Category: data ThinMorphism obj
+ Moonlight.Category: data ThinSiteKernel (validation :: ThinSiteValidation) obj
+ Moonlight.Category: data ThinSiteLookupError obj
+ Moonlight.Category: data ThinSiteObjectValueError
+ Moonlight.Category: data ThinSiteValidation
+ Moonlight.Category: data family Position polynomial :: Type -> Type
+ Moonlight.Category: denseIntSetDifference :: DenseIntSet -> DenseIntSet -> Maybe DenseIntSet
+ Moonlight.Category: denseIntSetEmpty :: Int -> Maybe DenseIntSet
+ Moonlight.Category: denseIntSetFoldl' :: (value -> Int -> value) -> value -> DenseIntSet -> value
+ Moonlight.Category: denseIntSetFromAscList :: Int -> [Int] -> Maybe DenseIntSet
+ Moonlight.Category: denseIntSetFull :: Int -> Maybe DenseIntSet
+ Moonlight.Category: denseIntSetIntersection :: DenseIntSet -> DenseIntSet -> Maybe DenseIntSet
+ Moonlight.Category: denseIntSetIntersects :: DenseIntSet -> DenseIntSet -> Maybe Bool
+ Moonlight.Category: denseIntSetInterval :: Int -> Int -> Int -> Maybe DenseIntSet
+ Moonlight.Category: denseIntSetIsSubsetOf :: DenseIntSet -> DenseIntSet -> Maybe Bool
+ Moonlight.Category: denseIntSetMember :: Int -> DenseIntSet -> Bool
+ Moonlight.Category: denseIntSetSize :: DenseIntSet -> Int
+ Moonlight.Category: denseIntSetUnion :: DenseIntSet -> DenseIntSet -> Maybe DenseIntSet
+ Moonlight.Category: denseIntSetUnions :: Int -> [DenseIntSet] -> Maybe DenseIntSet
+ Moonlight.Category: denseIntSetUniverseSize :: DenseIntSet -> Int
+ Moonlight.Category: denseIntSetWeight :: DenseIntSet -> Int
+ Moonlight.Category: enrichCompose :: EnrichedCategory c v => Ob c -> Ob c -> Ob c -> Mor v
+ Moonlight.Category: enrichHom :: EnrichedCategory c v => Ob c -> Ob c -> Ob v
+ Moonlight.Category: enrichIdentity :: EnrichedCategory c v => Ob c -> Mor v
+ Moonlight.Category: enumerateComposableChains :: FiniteComposableCategory c => c -> Natural -> [SizedComposableChain c]
+ Moonlight.Category: enumerateMorphisms :: FiniteComposableCategory c => c -> [Mor c]
+ Moonlight.Category: enumerateMorphismsFrom :: FiniteComposableCategory c => c -> Ob c -> [Mor c]
+ Moonlight.Category: enumerateNonDegenerateChainsByDimension :: FiniteComposableCategory c => c -> Natural -> [[ComposableChain c]]
+ Moonlight.Category: enumerateObjects :: FiniteComposableCategory c => c -> [Ob c]
+ Moonlight.Category: equalizer :: HasEqualizers c => c -> Mor c -> Mor c -> Maybe (Ob c, Mor c)
+ Moonlight.Category: foldDecoratedPresentation :: (ir -> decoration -> result) -> (boundary -> result -> result -> result) -> DecoratedPresentation boundary ir decoration -> result
+ Moonlight.Category: foldMapCoveringProductWithWitness :: forall k w f monoidValue. (CoveringFamily w, Monoid monoidValue) => (forall (member :: k). () => w member -> f member -> monoidValue) -> CoveringProduct w f -> monoidValue
+ Moonlight.Category: gamma :: GaloisConnection a b => b -> a
+ Moonlight.Category: hCompose :: HigherCategory c => c -> TwoMor c -> TwoMor c -> Either (CategoryError c) (TwoMor c)
+ Moonlight.Category: horizontalIdentity :: forall (objectValue :: object). DoubleCategory object double => ObjectWitness object double objectValue -> HorizontalMor object double objectValue objectValue
+ Moonlight.Category: id2 :: HigherCategory c => Mor c -> TwoMor c
+ Moonlight.Category: identity :: Category c => c -> Ob c -> Either (CategoryError c) (Mor c)
+ Moonlight.Category: identityThinMorphism :: obj -> ThinMorphism obj
+ Moonlight.Category: interchangeLaw :: forall object double (northWest :: object) (middleNorth :: object) (middleWest :: object) (center :: object) (eastNorth :: object) (middleEast :: object) (westSouth :: object) (middleSouth :: object) (southEast :: object). (DoubleCategory object double, Eq (Square object double northWest eastNorth westSouth southEast)) => Square object double northWest middleNorth middleWest center -> Square object double middleNorth eastNorth center middleEast -> Square object double middleWest center westSouth middleSouth -> Square object double center middleEast middleSouth southEast -> Maybe Bool
+ Moonlight.Category: inverse2 :: TwoCategory c => c -> TwoMor c -> Either (CategoryError c) (TwoMor c)
+ Moonlight.Category: invertibilityIndex :: (FiniteComposableCategory c, Ord (Ob c), Ord (Mor c)) => c -> InvertibilityIndex c
+ Moonlight.Category: leftBoundary :: category -> StructuredCospan category decoration -> Either (CategoryError category) (Ob category)
+ Moonlight.Category: leftUnitor :: Bicategory c => c -> Mor c -> Compositor c
+ Moonlight.Category: leftUnitorV :: MonoidalCategory v => Ob v -> Compositor v
+ Moonlight.Category: mapCoveringProduct :: forall {k} f g (w :: k -> Type). (forall (member :: k). () => f member -> g member) -> CoveringProduct w f -> CoveringProduct w g
+ Moonlight.Category: mapCoveringProductWithWitness :: (forall (member :: k). () => w member -> f member -> g member) -> CoveringProduct w f -> CoveringProduct w g
+ Moonlight.Category: mkComposableChain :: (Category c, Eq (Ob c)) => c -> Ob c -> [Mor c] -> Either (ComposableChainError c) (ComposableChain c)
+ Moonlight.Category: mkFinThinFunctor :: FinCat -> FinCat -> Map FinObjectId FinObjectId -> Either FinThinFunctorValidationError FinThinFunctor
+ Moonlight.Category: mkPathThinMorphism :: Ord obj => PathThinCat obj -> SitePathMorphism obj -> Maybe (PathThinMorphism obj)
+ Moonlight.Category: mkPathThinObject :: Ord obj => PathThinCat obj -> obj -> Maybe (PathThinObject obj)
+ Moonlight.Category: mkSiteManifest :: Ord obj => Set obj -> Map obj (Set obj) -> Map obj (Set obj) -> Either [SiteViolation obj] (SiteManifest obj)
+ Moonlight.Category: mkSitePathMorphism :: Ord obj => SitePathCategory obj -> NonEmpty obj -> Maybe (SitePathMorphism obj)
+ Moonlight.Category: mkSitePathObject :: Ord obj => SitePathCategory obj -> obj -> Maybe (SitePathObject obj)
+ Moonlight.Category: mkStructuredCospan :: (Category category, Eq (Ob category)) => category -> Mor category -> Mor category -> decoration -> Either (StructuredCospanError category) (StructuredCospan category decoration)
+ Moonlight.Category: mkThinMorphismBy :: (obj -> obj -> Bool) -> obj -> obj -> Maybe (ThinMorphism obj)
+ Moonlight.Category: monicMatchArrow :: MonicMatchWitness c -> Mor c
+ Moonlight.Category: monicMatchComponents :: AdhesiveCategory c => c -> Mor c -> Maybe (MonicMatchComponents c)
+ Moonlight.Category: pathThinCat :: SitePathCategory obj -> PathThinCat obj
+ Moonlight.Category: pathThinCodomainMorphism :: PathThinMorphism obj -> FinMor
+ Moonlight.Category: pathThinCodomainObject :: PathThinObject obj -> FinObj
+ Moonlight.Category: pbpoComplement :: PBPOAdhesiveCategory c => c -> Mor c -> MonicMatchWitness c -> Maybe (PBPOComplementWitness c)
+ Moonlight.Category: pbpoComplementBorrowedLeg :: PBPOComplementWitness c -> Mor c
+ Moonlight.Category: pbpoComplementComponents :: PBPOAdhesiveCategory c => c -> Mor c -> MonicMatchWitness c -> Maybe (PBPOComplementComponents c)
+ Moonlight.Category: pbpoComplementMonicMatch :: PBPOComplementWitness c -> MonicMatchWitness c
+ Moonlight.Category: pbpoComplementPullbackObject :: PBPOComplementWitness c -> Ob c
+ Moonlight.Category: pbpoComplementPullbackToBorrowed :: PBPOComplementWitness c -> Mor c
+ Moonlight.Category: pbpoComplementPullbackToMatch :: PBPOComplementWitness c -> Mor c
+ Moonlight.Category: pbpoComplementPushoutFromComplement :: PBPOComplementWitness c -> Mor c
+ Moonlight.Category: pbpoComplementPushoutFromMatch :: PBPOComplementWitness c -> Mor c
+ Moonlight.Category: pbpoComplementPushoutObject :: PBPOComplementWitness c -> Ob c
+ Moonlight.Category: pbpoComplementResidualLeg :: PBPOComplementWitness c -> Mor c
+ Moonlight.Category: pbpoComplementRuleLeg :: PBPOComplementWitness c -> Mor c
+ Moonlight.Category: pbpoPullbackSquareCommutes :: (Category c, Eq (Mor c)) => c -> PBPOComplementWitness c -> Bool
+ Moonlight.Category: pbpoPushoutSquareCommutes :: (Category c, Eq (Mor c)) => c -> PBPOComplementWitness c -> Bool
+ Moonlight.Category: positionsAt :: ParameterizedPolynomialFunctor polynomial => PolynomialParameter polynomial -> [Exists (ParameterizedPosition polynomial)]
+ Moonlight.Category: presentationGlue :: boundary -> DecoratedPresentation boundary ir decoration -> DecoratedPresentation boundary ir decoration -> DecoratedPresentation boundary ir decoration
+ Moonlight.Category: presentationLeaf :: ir -> decoration -> DecoratedPresentation boundary ir decoration
+ Moonlight.Category: productProj1 :: HasProducts c => c -> ProductOb c -> Mor c
+ Moonlight.Category: productProj2 :: HasProducts c => c -> ProductOb c -> Mor c
+ Moonlight.Category: productUniversal :: HasProducts c => c -> Mor c -> Mor c -> Mor c
+ Moonlight.Category: pullback :: HasPullbacks c => c -> Mor c -> Mor c -> Maybe (Ob c, Mor c, Mor c)
+ Moonlight.Category: pullbackMediator :: HasPullbacks c => c -> Mor c -> Mor c -> Mor c -> Mor c -> Maybe (Mor c)
+ Moonlight.Category: pushout :: HasPushouts c => c -> Mor c -> Mor c -> Maybe (Ob c, Mor c, Mor c)
+ Moonlight.Category: pushoutComplement :: AdhesiveCategory c => c -> Mor c -> MonicMatchWitness c -> Maybe (PushoutComplementWitness c)
+ Moonlight.Category: pushoutComplementBorrowedLeg :: PushoutComplementWitness c -> Mor c
+ Moonlight.Category: pushoutComplementComponents :: AdhesiveCategory c => c -> Mor c -> MonicMatchWitness c -> Maybe (PushoutComplementComponents c)
+ Moonlight.Category: pushoutComplementMonicMatch :: PushoutComplementWitness c -> MonicMatchWitness c
+ Moonlight.Category: pushoutComplementObject :: PushoutComplementWitness c -> Ob c
+ Moonlight.Category: pushoutComplementResidualLeg :: PushoutComplementWitness c -> Mor c
+ Moonlight.Category: pushoutComplementRuleLeg :: PushoutComplementWitness c -> Mor c
+ Moonlight.Category: pushoutComplementSquareCommutes :: (Category c, Eq (Mor c)) => c -> PushoutComplementWitness c -> Bool
+ Moonlight.Category: quotientMapMorphism :: Ord obj => SitePathQuotient obj -> SitePathMorphism obj -> Either (SitePathQuotientError obj) FinMor
+ Moonlight.Category: quotientMapObject :: Ord obj => SitePathQuotient obj -> SitePathObject obj -> Either (SitePathQuotientError obj) FinObj
+ Moonlight.Category: quotientPathThinMorphism :: SitePathMorphism obj -> PathThinMorphism obj
+ Moonlight.Category: quotientPathThinObject :: SitePathObject obj -> PathThinObject obj
+ Moonlight.Category: reconcileCompositionObligations :: [obligation] -> Natural -> Either (NonEmpty obligation) ()
+ Moonlight.Category: replaceCoveringProduct :: forall {k} w (member :: k) f. (forall (left :: k) (right :: k). () => w left -> w right -> Maybe (left :~: right)) -> w member -> f member -> CoveringProduct w f -> CoveringProduct w f
+ Moonlight.Category: restrictCoveringProduct :: forall {k} subset superset (f :: k -> Type). (forall (member :: k). () => subset member -> superset member) -> CoveringProduct superset f -> CoveringProduct subset f
+ Moonlight.Category: rightBoundary :: category -> StructuredCospan category decoration -> Either (CategoryError category) (Ob category)
+ Moonlight.Category: rightUnitor :: Bicategory c => c -> Mor c -> Compositor c
+ Moonlight.Category: rightUnitorV :: MonoidalCategory v => Ob v -> Compositor v
+ Moonlight.Category: singletonComposableChain :: Ob c -> ComposableChain c
+ Moonlight.Category: siteImportEdges :: Ord obj => SiteManifest obj -> Set (obj, obj)
+ Moonlight.Category: sitePathCategory :: ThinSiteKernel 'SiteValidated obj -> SitePathCategory obj
+ Moonlight.Category: sitePathManifest :: SitePathCategory obj -> SiteManifest obj
+ Moonlight.Category: sitePathMorphismsBetween :: Ord obj => SitePathCategory obj -> obj -> obj -> [SitePathMorphism obj]
+ Moonlight.Category: sitePathQuotient :: SitePathCategory obj -> SitePathQuotient obj
+ Moonlight.Category: siteReachable :: Ord obj => SiteManifest obj -> obj -> Set obj
+ Moonlight.Category: sizedComposableChain :: ComposableChain c -> SizedComposableChain c
+ Moonlight.Category: source :: Category c => c -> Mor c -> Either (CategoryError c) (Ob c)
+ Moonlight.Category: source2 :: HigherCategory c => TwoMor c -> Mor c
+ Moonlight.Category: squareBottom :: forall (northWest :: object) (northEast :: object) (southWest :: object) (southEast :: object). DoubleCategory object double => Square object double northWest northEast southWest southEast -> HorizontalMor object double southWest southEast
+ Moonlight.Category: squareLeft :: forall (northWest :: object) (northEast :: object) (southWest :: object) (southEast :: object). DoubleCategory object double => Square object double northWest northEast southWest southEast -> VerticalMor object double northWest southWest
+ Moonlight.Category: squareRight :: forall (northWest :: object) (northEast :: object) (southWest :: object) (southEast :: object). DoubleCategory object double => Square object double northWest northEast southWest southEast -> VerticalMor object double northEast southEast
+ Moonlight.Category: squareTop :: forall (northWest :: object) (northEast :: object) (southWest :: object) (southEast :: object). DoubleCategory object double => Square object double northWest northEast southWest southEast -> HorizontalMor object double northWest northEast
+ Moonlight.Category: tabulateCoveringProduct :: (forall (member :: k). () => w member -> f member) -> CoveringProduct w f
+ Moonlight.Category: target :: Category c => c -> Mor c -> Either (CategoryError c) (Ob c)
+ Moonlight.Category: target2 :: HigherCategory c => TwoMor c -> Mor c
+ Moonlight.Category: tensorMor :: MonoidalCategory v => v -> Mor v -> Mor v -> Either (CategoryError v) (Mor v, Compositor v)
+ Moonlight.Category: tensorOb :: MonoidalCategory v => Ob v -> Ob v -> Ob v
+ Moonlight.Category: thinSiteFinMorphism :: forall obj (validation :: ThinSiteValidation). Ord obj => ThinSiteKernel validation obj -> NonEmpty obj -> Either (ThinSiteLookupError obj) FinMor
+ Moonlight.Category: thinSiteFinMorphismByEndpoints :: forall obj (validation :: ThinSiteValidation). Ord obj => ThinSiteKernel validation obj -> obj -> obj -> Either (ThinSiteLookupError obj) FinMor
+ Moonlight.Category: thinSiteFinObject :: forall obj (validation :: ThinSiteValidation). Ord obj => ThinSiteKernel validation obj -> obj -> Either (ThinSiteLookupError obj) FinObj
+ Moonlight.Category: thinSiteImportKernel :: Ord obj => SiteManifest obj -> Either (SiteFinCatError obj) (ThinSiteKernel 'ImportsValidated obj)
+ Moonlight.Category: thinSiteKernel :: Ord obj => SiteManifest obj -> Either (SiteFinCatError obj) (ThinSiteKernel 'SiteValidated obj)
+ Moonlight.Category: thinSiteObjectValue :: forall (validation :: ThinSiteValidation) obj. ThinSiteKernel validation obj -> FinObj -> Either ThinSiteObjectValueError obj
+ Moonlight.Category: thresholds :: OrdinalGalois a b => [(a, b)]
+ Moonlight.Category: traverseMembers :: CoveringConstraints w c => (forall (member :: k). c member => w member -> r) -> [r]
+ Moonlight.Category: traverseMembers_ :: (CoveringConstraints w c, Applicative m) => (forall (member :: k). c member => w member -> m ()) -> m ()
+ Moonlight.Category: type CategoryError c = ();
+ Moonlight.Category: type Compositor c = ();
+ Moonlight.Category: type CoproductOb c;
+ Moonlight.Category: type Direction polynomial position;
+ Moonlight.Category: type HorizontalMor object double :: object -> object -> Type;
+ Moonlight.Category: type Mor c = (mor :: Type) | mor -> c;
+ Moonlight.Category: type Ob c = (ob :: Type) | ob -> c;
+ Moonlight.Category: type ObjectWitness object double :: object -> Type;
+ Moonlight.Category: type ParameterizedDirection polynomial position;
+ Moonlight.Category: type PolynomialParameter polynomial;
+ Moonlight.Category: type ProductOb c;
+ Moonlight.Category: type Square object double :: object -> object -> object -> object -> Type;
+ Moonlight.Category: type TwoMor c = ();
+ Moonlight.Category: type VerticalMor object double :: object -> object -> Type;
+ Moonlight.Category: type family PolynomialParameter polynomial
+ Moonlight.Category: unitOb :: MonoidalCategory v => Ob v
+ Moonlight.Category: vCompose :: HigherCategory c => c -> TwoMor c -> TwoMor c -> Either (CategoryError c) (TwoMor c)
+ Moonlight.Category: validateSiteManifest :: Ord obj => SiteManifest obj -> [SiteViolation obj]
+ Moonlight.Category: verticalIdentity :: forall (objectValue :: object). DoubleCategory object double => ObjectWitness object double objectValue -> VerticalMor object double objectValue objectValue
+ Moonlight.Category: whiskerLeft :: HigherCategory c => c -> Mor c -> TwoMor c -> Either (CategoryError c) (TwoMor c)
+ Moonlight.Category: whiskerRight :: HigherCategory c => c -> TwoMor c -> Mor c -> Either (CategoryError c) (TwoMor c)
+ Moonlight.Category: withMember :: CoveringConstraints w c => Exists w -> (forall (member :: k). c member => w member -> r) -> r
+ Moonlight.Category: witnessMonic :: AdhesiveCategory c => c -> Mor c -> Maybe (MonicMatchWitness c)
+ Moonlight.Category: }
+ Moonlight.Category.Indexed: (!) :: (Category c, Category d) => Nat c d f g -> c a b -> d (f :% a) (g :% b)
+ Moonlight.Category.Indexed: (%) :: Functor ftag => ftag -> Dom ftag a b -> Cod ftag (ftag :% a) (ftag :% b)
+ Moonlight.Category.Indexed: (&&&) :: forall (a :: k1) (x :: k1) (y :: k1). HasBinaryProducts k => k a x -> k a y -> k a (BinaryProduct k x y)
+ Moonlight.Category.Indexed: (***) :: forall (a1 :: k1) (b1 :: k1) (a2 :: k1) (b2 :: k1). HasBinaryProducts k => k a1 b1 -> k a2 b2 -> k (BinaryProduct k a1 a2) (BinaryProduct k b1 b2)
+ Moonlight.Category.Indexed: (+++) :: forall (a1 :: k1) (b1 :: k1) (a2 :: k1) (b2 :: k1). HasBinaryCoproducts k => k a1 b1 -> k a2 b2 -> k (BinaryCoproduct k a1 a2) (BinaryCoproduct k b1 b2)
+ Moonlight.Category.Indexed: (.) :: forall (b :: k) (c :: k) (a :: k). Category k1 => k1 b c -> k1 a b -> k1 a c
+ Moonlight.Category.Indexed: (:+++:) :: f1 -> f2 -> (:+++:) f1 f2
+ Moonlight.Category.Indexed: (|||) :: forall (x :: k1) (a :: k1) (y :: k1). HasBinaryCoproducts k => k x a -> k y a -> k (BinaryCoproduct k x y) a
+ Moonlight.Category.Indexed: AddConj :: (forall r. () => Either (x %1 -> r) (y %1 -> r) %1 -> r) -> (&) x y
+ Moonlight.Category.Indexed: Adjunction :: f -> g -> Profunctors c d (Costar f) (Star g) -> Profunctors c d (Star g) (Costar f) -> Adjunction (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) f g
+ Moonlight.Category.Indexed: Any :: f -> Any f
+ Moonlight.Category.Indexed: Apply :: Apply (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: CodiagCoprod :: CodiagCoprod (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: ColimitFunctor :: ColimitFunctor (j :: Type -> Type -> Type) (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: CoproductFunctor :: CoproductFunctor (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: Cotuple1 :: Obj c1 a -> Cotuple1 (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type) a
+ Moonlight.Category.Indexed: Cotuple2 :: Obj c2 a -> Cotuple2 (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type) a
+ Moonlight.Category.Indexed: DC :: Cograph c1 c2 (Const (Op c1 :**: c2) (->) ()) a b -> (:>>:) (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type) a b
+ Moonlight.Category.Indexed: DiagProd :: DiagProd (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: ForgetSimplex :: ForgetSimplex
+ Moonlight.Category.Indexed: FunctorCompose :: FunctorCompose (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) (e :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: Hom :: Hom (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: Id :: Id (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: Inj1 :: Inj1 (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: Inj2 :: Inj2 (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: LanFunctor :: p -> LanFunctor p (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: LanHaskF :: LanHaskF (p :: k) f
+ Moonlight.Category.Indexed: Left :: a -> Either a b
+ Moonlight.Category.Indexed: LimitFunctor :: LimitFunctor (j :: Type -> Type -> Type) (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: Magic :: Magic (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: NatAsFunctor :: Nat (Dom f) (Cod f) f g -> NatAsFunctor f g
+ Moonlight.Category.Indexed: Op :: k2 b a -> Op (k2 :: k -> k1 -> Type) (a :: k1) (b :: k)
+ Moonlight.Category.Indexed: OpOp :: OpOp (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: OpOpInv :: OpOpInv (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: Opp :: Opp (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: ProductFunctor :: ProductFunctor (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: Proj1 :: Proj1 (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: Proj2 :: Proj2 (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: RanFunctor :: p -> RanFunctor p (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: RanHask :: (forall c. () => Obj (Dom p) c -> Cod p a (p :% c) -> f :% c) -> RanHask p f a
+ Moonlight.Category.Indexed: RanHaskF :: RanHaskF (p :: k) f
+ Moonlight.Category.Indexed: Right :: b -> Either a b
+ Moonlight.Category.Indexed: Tuple :: Tuple (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: Wrap :: f -> h -> Wrap f h
+ Moonlight.Category.Indexed: [:***:] :: forall f1 f2. (Functor f1, Functor f2) => f1 -> f2 -> f1 :***: f2
+ Moonlight.Category.Indexed: [:**:] :: forall (a :: Type -> Type -> Type) a1 b1 (b :: Type -> Type -> Type) a2 b2. a a1 b1 -> b a2 b2 -> (a :**: b) (a1, a2) (b1, b2)
+ Moonlight.Category.Indexed: [:*:] :: forall p q (k :: Type -> Type -> Type). (Functor p, Functor q, Dom p ~ Dom q, Cod p ~ k, Cod q ~ k, HasBinaryProducts k) => p -> q -> p :*: q
+ Moonlight.Category.Indexed: [:+:] :: forall p q (k :: Type -> Type -> Type). (Functor p, Functor q, Dom p ~ Dom q, Cod p ~ k, Cod q ~ k, HasBinaryCoproducts k) => p -> q -> p :+: q
+ Moonlight.Category.Indexed: [:.:] :: forall g h. (Functor g, Functor h, Cod h ~ Dom g) => g -> h -> g :.: h
+ Moonlight.Category.Indexed: [AdjArrow] :: forall (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) f g. (Category c, Category d) => Adjunction c d f g -> AdjArrow c d
+ Moonlight.Category.Indexed: [CatA] :: forall ftag. (Functor ftag, Category (Dom ftag), Category (Cod ftag)) => ftag -> Cat (Dom ftag) (Cod ftag)
+ Moonlight.Category.Indexed: [Const] :: forall (c2 :: Type -> Type -> Type) x (c1 :: Type -> Type -> Type). Obj c2 x -> Const c1 c2 x
+ Moonlight.Category.Indexed: [Diag] :: forall (a :: Type -> Type -> Type) (b :: Type -> Type -> Type). Diag a b
+ Moonlight.Category.Indexed: [Fs] :: forall n1. Fin n1 -> Fin (S n1)
+ Moonlight.Category.Indexed: [Fz] :: forall {k} (n1 :: k). Fin (S n1)
+ Moonlight.Category.Indexed: [I12] :: forall (c :: Type -> Type -> Type) a1 (d :: Type -> Type -> Type) b1 f. Obj c a1 -> Obj d b1 -> f -> (f :% (a1, b1)) -> Cograph c d f (I1 a1) (I2 b1)
+ Moonlight.Category.Indexed: [I1A] :: forall (c :: Type -> Type -> Type) a1 b1 (d :: Type -> Type -> Type) f. c a1 b1 -> Cograph c d f (I1 a1) (I1 b1)
+ Moonlight.Category.Indexed: [I1] :: forall (a :: Type -> Type -> Type) a1 b1 (b :: Type -> Type -> Type). a a1 b1 -> (a :++: b) (I1 a1) (I1 b1)
+ Moonlight.Category.Indexed: [I2A] :: forall (d :: Type -> Type -> Type) a2 b2 (c :: Type -> Type -> Type) f. d a2 b2 -> Cograph c d f (I2 a2) (I2 b2)
+ Moonlight.Category.Indexed: [I2] :: forall (b :: Type -> Type -> Type) a2 b2 (a :: Type -> Type -> Type). b a2 b2 -> (a :++: b) (I2 a2) (I2 b2)
+ Moonlight.Category.Indexed: [LanHask] :: forall p c a f. Obj (Dom p) c -> Cod p (p :% c) a -> (f :% c) -> LanHask p f a
+ Moonlight.Category.Indexed: [Nat] :: forall c d (a :: Type -> Type -> Type) (b :: Type -> Type -> Type). (Functor c, Functor d, a ~ Dom c, a ~ Dom d, b ~ Cod c, b ~ Cod d) => c -> d -> (forall z. () => Obj a z -> Component c d z) -> Nat a b c d
+ Moonlight.Category.Indexed: [Unit] :: Unit () ()
+ Moonlight.Category.Indexed: [leftAdjoint] :: Adjunction (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) f g -> f
+ Moonlight.Category.Indexed: [leftAdjunctN] :: Adjunction (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) f g -> Profunctors c d (Costar f) (Star g)
+ Moonlight.Category.Indexed: [rightAdjoint] :: Adjunction (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) f g -> g
+ Moonlight.Category.Indexed: [rightAdjunctN] :: Adjunction (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) f g -> Profunctors c d (Star g) (Costar f)
+ Moonlight.Category.Indexed: [unOp] :: Op (k2 :: k -> k1 -> Type) (a :: k1) (b :: k) -> k2 b a
+ Moonlight.Category.Indexed: adjColimit :: forall (k :: Type -> Type -> Type) (j :: Type -> Type -> Type) l f. Category k => Adjunction k (Nat j k) l (Diag j k) -> Obj (Nat j k) f -> Cocone j k f (l :% f)
+ Moonlight.Category.Indexed: adjColimitFactorizer :: forall k (j :: Type -> Type -> Type) l f n. Adjunction k (Nat j k) l (Diag j k) -> Cocone j k f n -> k (l :% f) n
+ Moonlight.Category.Indexed: adjLimit :: forall (k :: Type -> Type -> Type) (j :: Type -> Type -> Type) r f. Category k => Adjunction (Nat j k) k (Diag j k) r -> Obj (Nat j k) f -> Cone j k f (r :% f)
+ Moonlight.Category.Indexed: adjLimitFactorizer :: forall (j :: Type -> Type -> Type) k r f n. Adjunction (Nat j k) k (Diag j k) r -> Cone j k f n -> k n (r :% f)
+ Moonlight.Category.Indexed: adjunctionCounit :: forall (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) f g. Adjunction c d f g -> Nat c c (f :.: g) (Id c)
+ Moonlight.Category.Indexed: adjunctionUnit :: forall (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) f g. Adjunction c d f g -> Nat d d (Id d) (g :.: f)
+ Moonlight.Category.Indexed: class Category (k1 :: k -> k -> Type)
+ Moonlight.Category.Indexed: class (Category Dom ftag, Category Cod ftag) => Functor ftag where {
+ Moonlight.Category.Indexed: class Category k => HasBinaryCoproducts (k :: k1 -> k1 -> Type) where {
+ Moonlight.Category.Indexed: class Category k => HasBinaryProducts (k :: k1 -> k1 -> Type) where {
+ Moonlight.Category.Indexed: class (Category j, Category k) => HasColimits (j :: Type -> Type -> Type) (k :: Type -> Type -> Type) where {
+ Moonlight.Category.Indexed: class Category k => HasInitialObject (k :: k1 -> k1 -> Type) where {
+ Moonlight.Category.Indexed: class (Functor p, Category k) => HasLeftKan p (k :: Type -> Type -> Type) where {
+ Moonlight.Category.Indexed: class (Category j, Category k) => HasLimits (j :: Type -> Type -> Type) (k :: Type -> Type -> Type) where {
+ Moonlight.Category.Indexed: class (Functor p, Category k) => HasRightKan p (k :: Type -> Type -> Type) where {
+ Moonlight.Category.Indexed: class Category k => HasTerminalObject (k :: k1 -> k1 -> Type) where {
+ Moonlight.Category.Indexed: coconeVertex :: forall (j :: Type -> Type -> Type) k f n. Cocone j k f n -> Obj k n
+ Moonlight.Category.Indexed: codegeneracyFirst :: forall {k} (n :: k). Obj (Simplex :: k -> k -> Type) n -> Simplex (S n) n
+ Moonlight.Category.Indexed: codegeneracyLast :: forall {k} (n :: k). Obj (Simplex :: k -> k -> Type) n -> Simplex (S n) n
+ Moonlight.Category.Indexed: codegeneracySucc :: forall {k} (n :: k). Simplex (S n) n -> Simplex (S (S n)) (S n)
+ Moonlight.Category.Indexed: cofaceFirst :: forall {k} (n :: k). Obj (Simplex :: k -> k -> Type) n -> Simplex n (S n)
+ Moonlight.Category.Indexed: cofaceLast :: forall {k} (n :: k). Obj (Simplex :: k -> k -> Type) n -> Simplex n (S n)
+ Moonlight.Category.Indexed: cofaceSucc :: forall {k} (n :: k). Simplex n (S n) -> Simplex (S n) (S (S n))
+ Moonlight.Category.Indexed: colimit :: HasColimits j k => Obj (Nat j k) f -> Cocone j k f (ColimitFam j k f)
+ Moonlight.Category.Indexed: colimitAdj :: forall (j :: Type -> Type -> Type) (k :: Type -> Type -> Type). HasColimits j k => Adjunction k (Nat j k) (ColimitFunctor j k) (Diag j k)
+ Moonlight.Category.Indexed: colimitFactorizer :: HasColimits j k => Cocone j k f n -> k (ColimitFam j k f) n
+ Moonlight.Category.Indexed: compAssoc :: (Functor f, Functor g, Functor h, Dom f ~ Cod g, Dom g ~ Cod h) => f -> g -> h -> Nat (Dom h) (Cod f) ((f :.: g) :.: h) (f :.: (g :.: h))
+ Moonlight.Category.Indexed: compAssocInv :: (Functor f, Functor g, Functor h, Dom f ~ Cod g, Dom g ~ Cod h) => f -> g -> h -> Nat (Dom h) (Cod f) (f :.: (g :.: h)) ((f :.: g) :.: h)
+ Moonlight.Category.Indexed: composeAdj :: forall (d :: Type -> Type -> Type) (e :: Type -> Type -> Type) f g (c :: Type -> Type -> Type) f' g'. Adjunction d e f g -> Adjunction c d f' g' -> Adjunction c e (f' :.: f) (g :.: g')
+ Moonlight.Category.Indexed: coneVertex :: forall (j :: Type -> Type -> Type) k f n. Cone j k f n -> Obj k n
+ Moonlight.Category.Indexed: constPostcompIn :: forall (j :: Type -> Type -> Type) (d :: Type -> Type -> Type) (k :: Type -> Type -> Type) x f g. Nat j d (Const k d x :.: f) g -> Nat j d (Const j d x) g
+ Moonlight.Category.Indexed: constPostcompOut :: forall (j :: Type -> Type -> Type) (d :: Type -> Type -> Type) f (k :: Type -> Type -> Type) x g. Nat j d f (Const k d x :.: g) -> Nat j d f (Const j d x)
+ Moonlight.Category.Indexed: constPrecompIn :: forall (j :: Type -> Type -> Type) (d :: Type -> Type -> Type) f (c :: Type -> Type -> Type) x g. Nat j d (f :.: Const j c x) g -> Nat j d (Const j d (f :% x)) g
+ Moonlight.Category.Indexed: constPrecompOut :: forall (j :: Type -> Type -> Type) (d :: Type -> Type -> Type) f g (c :: Type -> Type -> Type) x. Nat j d f (g :.: Const j c x) -> Nat j d f (Const j d (g :% x))
+ Moonlight.Category.Indexed: contAdj :: Adjunction (Op (->)) (->) (Opposite ((->) :-*: r) :.: OpOpInv (->)) ((->) :-*: r)
+ Moonlight.Category.Indexed: coprodAdj :: forall (k :: Type -> Type -> Type). HasBinaryCoproducts k => Adjunction k (k :**: k) (CoproductFunctor k) (DiagProd k)
+ Moonlight.Category.Indexed: data ( (a :: Type -> Type -> Type) :**: (b :: Type -> Type -> Type) ) c d
+ Moonlight.Category.Indexed: data AdjArrow (c :: Type -> Type -> Type) (d :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data Adjunction (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) f g
+ Moonlight.Category.Indexed: data Apply (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data Cat (a :: Type -> Type -> Type) (b :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data CodiagCoprod (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data Cograph (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) f a b
+ Moonlight.Category.Indexed: data ColimitFunctor (j :: Type -> Type -> Type) (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data Const (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type) x
+ Moonlight.Category.Indexed: data CoproductFunctor (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data Diag (a :: Type -> Type -> Type) (b :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data DiagProd (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data Either a b
+ Moonlight.Category.Indexed: data Fin n
+ Moonlight.Category.Indexed: data ForgetSimplex
+ Moonlight.Category.Indexed: data FunctorCompose (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) (e :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data Hom (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data I1 (a :: k)
+ Moonlight.Category.Indexed: data I2 (a :: k)
+ Moonlight.Category.Indexed: data Id (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data Inj1 (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data Inj2 (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data LanHask p f a
+ Moonlight.Category.Indexed: data LanHaskF (p :: k) f
+ Moonlight.Category.Indexed: data LimitFunctor (j :: Type -> Type -> Type) (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data Magic (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data Nat (a :: Type -> Type -> Type) (b :: Type -> Type -> Type) c d
+ Moonlight.Category.Indexed: data OpOp (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data OpOpInv (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data Opp (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data ProductFunctor (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data Proj1 (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data Proj2 (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data RanHaskF (p :: k) f
+ Moonlight.Category.Indexed: data S (n :: k)
+ Moonlight.Category.Indexed: data Simplex (a :: k) (b :: k1)
+ Moonlight.Category.Indexed: data Tuple (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: data Unit a b
+ Moonlight.Category.Indexed: data Void (a :: k) (b :: k1)
+ Moonlight.Category.Indexed: data Wrap f h
+ Moonlight.Category.Indexed: data Z
+ Moonlight.Category.Indexed: data Zero
+ Moonlight.Category.Indexed: data f1 :***: f2
+ Moonlight.Category.Indexed: data g :.: h
+ Moonlight.Category.Indexed: data p :+: q
+ Moonlight.Category.Indexed: finToNatural :: Fin n -> Natural
+ Moonlight.Category.Indexed: idAdj :: forall (k :: Type -> Type -> Type). Category k => Adjunction k k (Id k) (Id k)
+ Moonlight.Category.Indexed: idPostcomp :: Functor f => f -> Nat (Dom f) (Cod f) (Id (Cod f) :.: f) f
+ Moonlight.Category.Indexed: idPostcompInv :: Functor f => f -> Nat (Dom f) (Cod f) f (Id (Cod f) :.: f)
+ Moonlight.Category.Indexed: idPrecomp :: Functor f => f -> Nat (Dom f) (Cod f) (f :.: Id (Dom f)) f
+ Moonlight.Category.Indexed: idPrecompInv :: Functor f => f -> Nat (Dom f) (Cod f) f (f :.: Id (Dom f))
+ Moonlight.Category.Indexed: initialObject :: HasInitialObject k => Obj k (InitialObject k)
+ Moonlight.Category.Indexed: initialize :: forall (a :: k1). HasInitialObject k => Obj k a -> k (InitialObject k) a
+ Moonlight.Category.Indexed: inj1 :: forall (x :: k1) (y :: k1). HasBinaryCoproducts k => Obj k x -> Obj k y -> k x (BinaryCoproduct k x y)
+ Moonlight.Category.Indexed: inj2 :: forall (x :: k1) (y :: k1). HasBinaryCoproducts k => Obj k x -> Obj k y -> k y (BinaryCoproduct k x y)
+ Moonlight.Category.Indexed: lan :: HasLeftKan p k => p -> Obj (Nat (Dom p) k) f -> Nat (Dom p) k f (LanFam p k f :.: p)
+ Moonlight.Category.Indexed: lanAdj :: forall p (k :: Type -> Type -> Type). HasLeftKan p k => p -> Adjunction (Nat (Cod p) k) (Nat (Dom p) k) (LanFunctor p k) (Precompose p k)
+ Moonlight.Category.Indexed: lanF :: forall p (k :: Type -> Type -> Type) f. HasLeftKan p k => p -> Obj (Nat (Dom p) k) f -> Obj (Nat (Cod p) k) (LanFam p k f)
+ Moonlight.Category.Indexed: lanF' :: forall p (k :: Type -> Type -> Type) f. Nat (Dom p) k f (LanFam p k f :.: p) -> Obj (Nat (Cod p) k) (LanFam p k f)
+ Moonlight.Category.Indexed: lanFactorizer :: HasLeftKan p k => Nat (Dom p) k f (h :.: p) -> Nat (Cod p) k (LanFam p k f) h
+ Moonlight.Category.Indexed: leftAdjointPreservesColimits :: forall (j :: Type -> Type -> Type) c (d :: Type -> Type -> Type) f g t. (HasColimits j c, HasColimits j d) => Adjunction c d f g -> Obj (Nat j d) t -> c (f :% Colimit t) (Colimit (f :.: t))
+ Moonlight.Category.Indexed: leftAdjointPreservesColimitsInv :: forall (j :: Type -> Type -> Type) c (d :: Type -> Type -> Type) f t. (HasColimits j c, HasColimits j d) => Obj (Nat d c) f -> Obj (Nat j d) t -> c (ColimitFam j c (f :.: t)) (f :% ColimitFam j d t)
+ Moonlight.Category.Indexed: leftAdjunct :: Adjunction c d f g -> Obj d a -> c (f :% a) b -> d a (g :% b)
+ Moonlight.Category.Indexed: limit :: HasLimits j k => Obj (Nat j k) f -> Cone j k f (LimitFam j k f)
+ Moonlight.Category.Indexed: limitAdj :: forall (j :: Type -> Type -> Type) (k :: Type -> Type -> Type). HasLimits j k => Adjunction (Nat j k) k (Diag j k) (LimitFunctor j k)
+ Moonlight.Category.Indexed: limitFactorizer :: HasLimits j k => Cone j k f n -> k n (LimitFam j k f)
+ Moonlight.Category.Indexed: magic :: forall {k1} {k2} (a :: k1) (b :: k2) x. Void a b -> x
+ Moonlight.Category.Indexed: mkAdjunction :: (Functor f, Functor g, Dom f ~ d, Cod f ~ c, Dom g ~ c, Cod g ~ d) => f -> g -> (forall a b. () => Obj d a -> c (f :% a) b -> d a (g :% b)) -> (forall a b. () => Obj c b -> d a (g :% b) -> c (f :% a) b) -> Adjunction c d f g
+ Moonlight.Category.Indexed: mkAdjunctionInit :: (Functor f, Functor g, Dom f ~ d, Cod f ~ c, Dom g ~ c, Cod g ~ d) => f -> g -> (forall a. () => Obj d a -> d a (g :% (f :% a))) -> (forall a b. () => Obj c b -> d a (g :% b) -> c (f :% a) b) -> Adjunction c d f g
+ Moonlight.Category.Indexed: mkAdjunctionTerm :: (Functor f, Functor g, Dom f ~ d, Cod f ~ c, Dom g ~ c, Cod g ~ d) => f -> g -> (forall a b. () => Obj d a -> c (f :% a) b -> d a (g :% b)) -> (forall b. () => Obj c b -> c (f :% (g :% b)) b) -> Adjunction c d f g
+ Moonlight.Category.Indexed: mkAdjunctionUnits :: (Functor f, Functor g, Dom f ~ d, Cod f ~ c, Dom g ~ c, Cod g ~ d) => f -> g -> (forall a. () => Obj d a -> Component (Id d) (g :.: f) a) -> (forall a. () => Obj c a -> Component (f :.: g) (Id c) a) -> Adjunction c d f g
+ Moonlight.Category.Indexed: natId :: Functor f => f -> Nat (Dom f) (Cod f) f f
+ Moonlight.Category.Indexed: newtype ( (c1 :: Type -> Type -> Type) :>>: (c2 :: Type -> Type -> Type) ) a b
+ Moonlight.Category.Indexed: newtype Any f
+ Moonlight.Category.Indexed: newtype Cotuple1 (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type) a
+ Moonlight.Category.Indexed: newtype Cotuple2 (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type) a
+ Moonlight.Category.Indexed: newtype LanFunctor p (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: newtype NatAsFunctor f g
+ Moonlight.Category.Indexed: newtype Op (k2 :: k -> k1 -> Type) (a :: k1) (b :: k)
+ Moonlight.Category.Indexed: newtype RanFunctor p (k :: Type -> Type -> Type)
+ Moonlight.Category.Indexed: newtype RanHask p f a
+ Moonlight.Category.Indexed: newtype x & y
+ Moonlight.Category.Indexed: o :: forall (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) (e :: Type -> Type -> Type) j k f g. (Category c, Category d, Category e) => Nat d e j k -> Nat c d f g -> Nat c e (j :.: f) (k :.: g)
+ Moonlight.Category.Indexed: obj :: forall (m :: Multiplicity) a. Obj (FUN m :: Type -> Type -> Type) a
+ Moonlight.Category.Indexed: pattern HomXF :: Functor f => Obj (Cod f) x -> f -> x :*%: f
+ Moonlight.Category.Indexed: pattern Swap :: forall (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type). (Category c1, Category c2) => Swap c1 c2
+ Moonlight.Category.Indexed: pattern Star :: Functor f => f -> Star f
+ Moonlight.Category.Indexed: postcomposeAdj :: forall (e :: Type -> Type -> Type) (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) f g. Category e => Adjunction c d f g -> Adjunction (Nat e c) (Nat e d) (Postcompose f e) (Postcompose g e)
+ Moonlight.Category.Indexed: precomposeAdj :: forall (e :: Type -> Type -> Type) (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) f g. Category e => Adjunction c d f g -> Adjunction (Nat c e) (Nat d e) (Precompose g e) (Precompose f e)
+ Moonlight.Category.Indexed: prodAdj :: forall (k :: Type -> Type -> Type). HasBinaryProducts k => Adjunction (k :**: k) k (DiagProd k) (ProductFunctor k)
+ Moonlight.Category.Indexed: proj1 :: forall (x :: k1) (y :: k1). HasBinaryProducts k => Obj k x -> Obj k y -> k (BinaryProduct k x y) x
+ Moonlight.Category.Indexed: proj2 :: forall (x :: k1) (y :: k1). HasBinaryProducts k => Obj k x -> Obj k y -> k (BinaryProduct k x y) y
+ Moonlight.Category.Indexed: ran :: HasRightKan p k => p -> Obj (Nat (Dom p) k) f -> Nat (Dom p) k (RanFam p k f :.: p) f
+ Moonlight.Category.Indexed: ranAdj :: forall p (k :: Type -> Type -> Type). HasRightKan p k => p -> Adjunction (Nat (Dom p) k) (Nat (Cod p) k) (Precompose p k) (RanFunctor p k)
+ Moonlight.Category.Indexed: ranF :: forall p (k :: Type -> Type -> Type) f. HasRightKan p k => p -> Obj (Nat (Dom p) k) f -> Obj (Nat (Cod p) k) (RanFam p k f)
+ Moonlight.Category.Indexed: ranF' :: forall p (k :: Type -> Type -> Type) f. Nat (Dom p) k (RanFam p k f :.: p) f -> Obj (Nat (Cod p) k) (RanFam p k f)
+ Moonlight.Category.Indexed: ranFactorizer :: HasRightKan p k => Nat (Dom p) k (h :.: p) f -> Nat (Cod p) k h (RanFam p k f)
+ Moonlight.Category.Indexed: rightAdjointPreservesLimits :: forall (j :: Type -> Type -> Type) (c :: Type -> Type -> Type) d f g t. (HasLimits j c, HasLimits j d) => Adjunction c d f g -> Obj (Nat j c) t -> d (Limit (g :.: t)) (g :% Limit t)
+ Moonlight.Category.Indexed: rightAdjointPreservesLimitsInv :: forall (j :: Type -> Type -> Type) (c :: Type -> Type -> Type) d g t. (HasLimits j c, HasLimits j d) => Obj (Nat c d) g -> Obj (Nat j c) t -> d (g :% LimitFam j c t) (LimitFam j d (g :.: t))
+ Moonlight.Category.Indexed: rightAdjunct :: Adjunction c d f g -> Obj c b -> d a (g :% b) -> c (f :% a) b
+ Moonlight.Category.Indexed: simplexCollapse :: forall {k} (n :: k). Obj (Simplex :: k -> k -> Type) n -> Simplex n Z
+ Moonlight.Category.Indexed: simplexExtendDomain :: forall {k1} {k2} (a :: k1) (b :: k2). Simplex a (S b) -> Simplex (S a) (S b)
+ Moonlight.Category.Indexed: simplexFirstVertex :: forall {k} (n :: k). Obj (Simplex :: k -> k -> Type) n -> Simplex Z n
+ Moonlight.Category.Indexed: simplexSucc :: forall {k} (n :: k). Obj (Simplex :: k -> k -> Type) n -> Obj (Simplex :: Type -> Type -> Type) (S n)
+ Moonlight.Category.Indexed: simplexValues :: forall {k1} {k2} (a :: k1) (b :: k2). Simplex a b -> [Natural]
+ Moonlight.Category.Indexed: simplexWeakenCodomain :: forall {k1} {k2} (a :: k1) (b :: k2). Simplex a b -> Simplex a (S b)
+ Moonlight.Category.Indexed: simplexZero :: Obj (Simplex :: Type -> Type -> Type) Z
+ Moonlight.Category.Indexed: src :: forall (a :: k) (b :: k). Category k1 => k1 a b -> Obj k1 a
+ Moonlight.Category.Indexed: srcF :: forall (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) f g. Nat c d f g -> f
+ Moonlight.Category.Indexed: terminalObject :: HasTerminalObject k => Obj k (TerminalObject k)
+ Moonlight.Category.Indexed: terminate :: forall (a :: k1). HasTerminalObject k => Obj k a -> k a (TerminalObject k)
+ Moonlight.Category.Indexed: tgt :: forall (a :: k) (b :: k). Category k1 => k1 a b -> Obj k1 b
+ Moonlight.Category.Indexed: tgtF :: forall (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) f g. Nat c d f g -> g
+ Moonlight.Category.Indexed: type (k :: Type -> Type -> Type) :-*: x = Hom k :.: Tuple2 Op k k x
+ Moonlight.Category.Indexed: type BinaryCoproduct (k :: k1 -> k1 -> Type) (x :: Kind k) (y :: Kind k) :: Kind k;
+ Moonlight.Category.Indexed: type BinaryProduct (k :: k1 -> k1 -> Type) (x :: Kind k) (y :: Kind k) :: Kind k;
+ Moonlight.Category.Indexed: type Cocone (j :: Type -> Type -> Type) (k :: Type -> Type -> Type) f n = Nat j k f Const j k n
+ Moonlight.Category.Indexed: type Cod ftag :: Type -> Type -> Type;
+ Moonlight.Category.Indexed: type Colimit f = ColimitFam Dom f Cod f f
+ Moonlight.Category.Indexed: type ColimitFam (j :: Type -> Type -> Type) (k :: Type -> Type -> Type) f;
+ Moonlight.Category.Indexed: type Component f g z = Cod f f :% z g :% z
+ Moonlight.Category.Indexed: type Cone (j :: Type -> Type -> Type) (k :: Type -> Type -> Type) f n = Nat j k Const j k n f
+ Moonlight.Category.Indexed: type ConstF f = Const Dom f Cod f
+ Moonlight.Category.Indexed: type Costar f = HomF f Id Cod f
+ Moonlight.Category.Indexed: type Curry1 (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type) f = Postcompose f c2 :.: Tuple c1 c2
+ Moonlight.Category.Indexed: type Curry2 (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type) f = Postcompose f c1 :.: Curry1 c2 c1 Swap c2 c1
+ Moonlight.Category.Indexed: type DiagF f = Diag Dom f Cod f
+ Moonlight.Category.Indexed: type Dom ftag :: Type -> Type -> Type;
+ Moonlight.Category.Indexed: type Endo (k :: Type -> Type -> Type) = Nat k k
+ Moonlight.Category.Indexed: type EndoFunctorCompose (k :: Type -> Type -> Type) = FunctorCompose k k k
+ Moonlight.Category.Indexed: type FunctorOf (a :: Type -> Type -> Type) (b :: Type -> Type -> Type) t = (Functor t, Dom t ~ a, Cod t ~ b)
+ Moonlight.Category.Indexed: type HomF f g = Hom Cod f :.: Opposite f :***: g
+ Moonlight.Category.Indexed: type InitialObject (k :: k1 -> k1 -> Type) :: Kind k;
+ Moonlight.Category.Indexed: type Lan p f = LanFam p Cod f f
+ Moonlight.Category.Indexed: type LanFam p (k :: Type -> Type -> Type) f;
+ Moonlight.Category.Indexed: type Limit f = LimitFam Dom f Cod f f
+ Moonlight.Category.Indexed: type LimitFam (j :: Type -> Type -> Type) (k :: Type -> Type -> Type) f;
+ Moonlight.Category.Indexed: type f :~> g = forall (c :: Type -> Type -> Type) (d :: Type -> Type -> Type). (c ~ Dom f, c ~ Dom g, d ~ Cod f, d ~ Cod g) => Nat c d f g
+ Moonlight.Category.Indexed: type Obj (k2 :: k1 -> k1 -> k) (a :: k1) = k2 a a
+ Moonlight.Category.Indexed: type Opposite f = Opp Dom f Cod f :.: Tuple1 Op Nat Dom f Cod f Op Dom f f
+ Moonlight.Category.Indexed: type Postcompose f (c :: Type -> Type -> Type) = FunctorCompose c Dom f Cod f :.: Tuple1 Nat Dom f Cod f Nat c Dom f f
+ Moonlight.Category.Indexed: type Precompose f (e :: Type -> Type -> Type) = FunctorCompose Dom f Cod f e :.: Tuple2 Nat Cod f e Nat Dom f Cod f f
+ Moonlight.Category.Indexed: type Presheaves (k :: Type -> Type -> Type) = Nat Op k (->)
+ Moonlight.Category.Indexed: type ProfunctorOf (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) t = (FunctorOf Op c :**: d (->) t, Category c, Category d)
+ Moonlight.Category.Indexed: type Profunctors (c :: Type -> Type -> Type) (d :: Type -> Type -> Type) = Nat Op d :**: c (->)
+ Moonlight.Category.Indexed: type Ran p f = RanFam p Cod f f
+ Moonlight.Category.Indexed: type RanFam p (k :: Type -> Type -> Type) f;
+ Moonlight.Category.Indexed: type SSet = Presheaves Simplex :: Type -> Type -> Type
+ Moonlight.Category.Indexed: type SimplexFin (n :: k) = Fin S n
+ Moonlight.Category.Indexed: type StandardSimplex n = Simplex :: Type -> Type -> Type :-*: n
+ Moonlight.Category.Indexed: type Star f = HomF Id Cod f f
+ Moonlight.Category.Indexed: type Swap (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type) = Proj2 c1 c2 :***: Proj1 c1 c2 :.: DiagProd c1 :**: c2
+ Moonlight.Category.Indexed: type TerminalObject (k :: k1 -> k1 -> Type) :: Kind k;
+ Moonlight.Category.Indexed: type Tuple1 (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type) a = Const c2 c1 a :***: Id c2 :.: DiagProd c2
+ Moonlight.Category.Indexed: type Tuple2 (c1 :: Type -> Type -> Type) (c2 :: Type -> Type -> Type) a = Swap c2 c1 :.: Tuple1 c2 c1 a
+ Moonlight.Category.Indexed: type f :%*: x = Cod f :-*: x :.: Opposite f
+ Moonlight.Category.Indexed: type family TerminalObject (k :: k1 -> k1 -> Type) :: Kind k
+ Moonlight.Category.Indexed: type ftag :% a;
+ Moonlight.Category.Indexed: type x :*%: f = x :*-: Cod f :.: f
+ Moonlight.Category.Indexed: voidNat :: forall f g (d :: Type -> Type -> Type). (Functor f, Functor g, Dom f ~ (Void :: Type -> Type -> Type), Dom g ~ (Void :: Type -> Type -> Type), Cod f ~ d, Cod g ~ d) => f -> g -> Nat (Void :: Type -> Type -> Type) d f g
+ Moonlight.Category.Indexed: }
Files
- CHANGELOG.md +10/−0
- README.md +45/−7
- bench/finite/FinCat.hs +51/−2
- bench/simplicial/SimplicialNerve.hs +33/−9
- bench/site/SiteCases.hs +11/−12
- bench/site/SiteManifest.hs +13/−8
- bench/site/SitePathQuotient.hs +32/−15
- moonlight-category.cabal +11/−8
- src-abstract/Moonlight/Category/Pure/FiniteComposable.hs +48/−17
- src-laws/Moonlight/Category/Effect/Harness/Site.hs +12/−7
- src-laws/Moonlight/Category/Effect/Laws/Site.hs +19/−13
- src-public/Moonlight/Category.hs +20/−1
- src-simplicial/Moonlight/Category/Pure/Simplicial/Nerve.hs +25/−17
- src-simplicial/Moonlight/Category/Simplicial.hs +14/−0
- src-site/Moonlight/Category/Pure/Site.hs +21/−3
- src-site/Moonlight/Category/Pure/Site/Category.hs +7/−11
- src-site/Moonlight/Category/Pure/Site/Compile.hs +121/−46
- src-site/Moonlight/Category/Pure/Site/Quotient.hs +6/−9
- test/abstract/FiniteComposableSpec.hs +9/−1
- test/facade/FacadeSiteNerveSpec.hs +70/−0
- test/facade/FacadeTests.hs +4/−1
- test/simplicial/NerveSpec.hs +25/−13
- test/site/SiteSpec.hs +122/−1
CHANGELOG.md view
@@ -1,5 +1,15 @@ # Changelog +## 1.1.0.0 - 2026-08-21++- Breaking: replace the lossy import-category projection with a+ provenance-preserving site kernel and total object lookup.+- Breaking: replace fallible nerve-chain vertex recovery with total validated+ chain vertices, and rename the normalized and identity-inclusive nerve+ constructors to make their semantic and resource distinction explicit.+- Compatibility: build the complete test and benchmark closure on GHC 9.10.3,+ 9.12.4, and 9.14.1 through `moonlight-pale:test-0.1.0.2` and `base >= 4.20`.+ ## 1.0.0.0 - 2026-08-20 - Publish the validated GHC 9.10.3, 9.12.4, and 9.14.1 public-library surface
README.md view
@@ -45,13 +45,13 @@ ## Public modules -| Module | Surface |-| --- | --- |-| `Moonlight.Category` | The broad categorical surface: `Category` and composition, the limit/colimit and higher-category towers, finite and thin categories, invertibility/groupoids, adhesive & PBPO witnesses, structured cospans, double categories, decorated composition, Galois connections, polynomial functors, covering families, and the site/path layer. |-| `Moonlight.Category.Indexed` | The indexed, typed-arrow category-theory layer adapted from `data-category`: indexed categories, functors, natural transformations, adjunctions, (co)limits, Kan extensions, products/coproducts and the simplex category. |-| `Moonlight.Category.Presentation` | The finite-category authoring surface: named objects, named nonidentity morphisms, strict-order `below` declarations, identities in equations, and compilation to `FinCat`. |-| `Moonlight.Category.Notation` | Scoped query and composition helpers for already-compiled `FinCat` values. |-| `Moonlight.Category.Simplicial` | The public simplicial surface: Δ, simplicial sets, nerves, Kan interfaces, homotopy queries, and pure validation. |+| Module | Cabal component | Surface |+| --- | --- | --- |+| `Moonlight.Category` | `moonlight-category` | The broad categorical surface: `Category` and composition, the limit/colimit and higher-category towers, finite and thin categories, invertibility/groupoids, adhesive & PBPO witnesses, structured cospans, double categories, decorated composition, Galois connections, polynomial functors, covering families, and the site/path layer. |+| `Moonlight.Category.Indexed` | `moonlight-category` | The indexed, typed-arrow category-theory layer adapted from `data-category`: indexed categories, functors, natural transformations, adjunctions, (co)limits, Kan extensions, products/coproducts and the simplex category. |+| `Moonlight.Category.Presentation` | `moonlight-category` | The finite-category authoring surface: named objects, named nonidentity morphisms, strict-order `below` declarations, identities in equations, and compilation to `FinCat`. |+| `Moonlight.Category.Notation` | `moonlight-category` | Scoped query and composition helpers for already-compiled `FinCat` values. |+| `Moonlight.Category.Simplicial` | `moonlight-category:simplicial` | The public simplicial surface: Δ, simplicial sets, nerves, Kan interfaces, homotopy queries, and pure validation. | The `Moonlight.Category.Pure.*` leaves live in named implementation sublibraries: `abstract` for generic category theory, `finite` for `FinCat`/presentation runtime,@@ -59,6 +59,44 @@ typed-arrow layer, and `simplicial` for Δ, simplicial sets, nerves and Kan interfaces. Effectful law harnesses and cross-package test fixtures live in the `laws` sublibrary rather than the pure production components.++### Main-library and simplicial consumers++The simplicial facade is a separate public Cabal component. A program using both+facades must request both components explicitly:++```cabal+build-depends:+ moonlight-category >= 1.1.0.0 && < 1.2,+ moonlight-category:simplicial >= 1.1.0.0 && < 1.2+```++```haskell+import Moonlight.Category+import Moonlight.Category.Simplicial+```++Those two facades are the ordinary consumer path. `Moonlight.Category` owns site+compilation and provenance lookup; `Moonlight.Category.Simplicial` owns nerves and+their simplicial queries. A consumer should not need a `Pure.*` import to compile a+site's import category, inspect its nerve, or recover source object names.++### Site provenance and nerves++Use `thinSiteImportKernel` when only the import category is required, then obtain+its `FinCat` with `thinSiteKernelCodomain`. Use `thinSiteKernel` when full cover+validation is required. Site-derived `FinObjectId` values are kernel-relative+representation tokens: their numerical order is not a semantic name or a stable+persistence contract. Preserve the `ThinSiteKernel` and cross the boundary through+`thinSiteFinObject` and `thinSiteObjectValue` instead of reconstructing an object+map from `siteObjects`.++For ordinary topological or combinatorial work, use `normalizedNerve`; it enumerates+nonidentity chains and closes under faces. `unnormalizedNerve` materializes every+composable chain, including identity insertions, and is deliberately for small law+or diagnostic workloads: its truncation bound is not a memory budget. A validated+`ComposableChain` retains its vertices, so `chainVertices` is a total projection;+there is no fallible category lookup after construction. ## Dependency footprint
bench/finite/FinCat.hs view
@@ -60,10 +60,12 @@ mkFinObject, ) import Moonlight.Category.Pure.FiniteComposable- ( SizedComposableChain,+ ( ComposableChain,+ SizedComposableChain, appendComposableMorphism, chainDimension, chainMorphisms,+ chainVertices, enumerateComposableChains, sizedChainDimension, sizedChainValue,@@ -92,7 +94,8 @@ bgroup "prepared FinCat operations" (thinOrderCases & fmap preparedFinCatBenchmark),- bench "appendComposableMorphism identity x1024" (nf repeatedChainAppendWeight 1024)+ bench "appendComposableMorphism identity x1024" (nf repeatedChainAppendWeight 1024),+ chainProjectionBenchmarks ] type ThinOrderCase :: Type data ThinOrderCase = ThinOrderCase@@ -282,6 +285,52 @@ fromIntegral (chainDimension chainValue) + sum (finMorphismWeight <$> chainMorphisms chainValue) )++chainProjectionBenchmarks :: Benchmark+chainProjectionBenchmarks =+ env (prepareBenchValue (repeatedChainProjectionSetup 1024)) $ \(PreparedComposableChain chainValue) ->+ bgroup+ "ComposableChain projections identity x1024"+ [ bench "chainMorphisms" (nf chainMorphismProjectionWeight chainValue),+ bench "chainVertices" (nf chainVertexProjectionWeight chainValue)+ ]++newtype PreparedComposableChain = PreparedComposableChain (ComposableChain FinCat)++instance NFData PreparedComposableChain where+ rnf (PreparedComposableChain chainValue) =+ chainMorphismProjectionWeight chainValue `seq`+ chainVertexProjectionWeight chainValue `seq`+ ()++repeatedChainProjectionSetup :: Int -> BenchSetup PreparedComposableChain+repeatedChainProjectionSetup appendCount =+ BenchSetup+ (PreparedComposableChain <$> runBenchSetup (repeatedIdentityChain appendCount))++repeatedIdentityChain :: Int -> BenchSetup (ComposableChain FinCat)+repeatedIdentityChain appendCount =+ BenchSetup $ do+ startObject <- first (const "sample FinCat is missing object 0") (mkFinObject sampleFinCat (FinObjectId 0))+ let identityMorphism = finObjectIdentityMor startObject+ first+ (const "the sample identity morphism did not append to its own chain")+ ( foldM+ (appendComposableMorphism sampleFinCat)+ (singletonComposableChain startObject)+ (replicate appendCount identityMorphism)+ )++chainMorphismProjectionWeight :: ComposableChain FinCat -> Int+chainMorphismProjectionWeight chainValue =+ sum (finMorphismWeight <$> chainMorphisms chainValue)++chainVertexProjectionWeight :: ComposableChain FinCat -> Int+chainVertexProjectionWeight chainValue =+ chainVertices chainValue+ & NonEmpty.toList+ & fmap (finObjectIdWeight . finObjId)+ & sum sourceBucketWeight :: FinCat -> Int sourceBucketWeight categoryValue =
bench/simplicial/SimplicialNerve.hs view
@@ -24,13 +24,16 @@ mkFinCat, ) import Moonlight.Category.Simplicial- ( NerveSimplex,+ ( GeneratedSSet,+ NerveSimplex, TruncatedNormalizedSSet,- nerve,+ generatedSimplicesAtDimension, nerveSimplexChain, nerveSimplexDimension,+ normalizedNerve, simplicesAtDimension, truncationBound,+ unnormalizedNerve, ) import Numeric.Natural (Natural) import SimplicialWeight (naturalWeight)@@ -45,7 +48,11 @@ nerveBenchmark :: NerveCase -> Benchmark nerveBenchmark nerveCase = env (prepareNerveCategory nerveCase) $ \categoryValue ->- bench (nerveCaseLabel nerveCase) (nf preparedNerveWeight categoryValue)+ bgroup+ (nerveCaseLabel nerveCase)+ [ bench "normalized nonidentity chains" (nf preparedNormalizedNerveWeight categoryValue),+ bench "unnormalized identity-complete chains" (nf preparedUnnormalizedNerveWeight categoryValue)+ ] data NerveCase = NerveCase { nerveCaseObjectCount :: !Int,@@ -132,17 +139,28 @@ thinMorphismId sourceKey targetKey = FinGeneratorMorphismId (FinGeneratorId (sourceKey * 1024 + targetKey)) -nerveWeight :: Natural -> FinCat -> Int-nerveWeight upperBound categoryValue =- nerve categoryValue upperBound+normalizedNerveWeight :: Natural -> FinCat -> Int+normalizedNerveWeight upperBound categoryValue =+ normalizedNerve categoryValue upperBound & nerveSSetWeight -preparedNerveWeight :: PreparedNerveCategory -> Int-preparedNerveWeight prepared =- nerveWeight+preparedNormalizedNerveWeight :: PreparedNerveCategory -> Int+preparedNormalizedNerveWeight prepared =+ normalizedNerveWeight (preparedNerveTruncationBound prepared) (preparedNerveCategory prepared) +unnormalizedNerveWeight :: Natural -> FinCat -> Int+unnormalizedNerveWeight upperBound categoryValue =+ unnormalizedNerve categoryValue upperBound+ & generatedNerveSSetWeight upperBound++preparedUnnormalizedNerveWeight :: PreparedNerveCategory -> Int+preparedUnnormalizedNerveWeight prepared =+ unnormalizedNerveWeight+ (preparedNerveTruncationBound prepared)+ (preparedNerveCategory prepared)+ preparedNerveCategoryWeight :: PreparedNerveCategory -> Int preparedNerveCategoryWeight prepared = length (allObjects (preparedNerveCategory prepared))@@ -153,6 +171,12 @@ nerveSSetWeight simplicialSet = [0 .. truncationBound simplicialSet] & fmap (nerveSimplicesWeight . simplicesAtDimension simplicialSet)+ & sum++generatedNerveSSetWeight :: Natural -> GeneratedSSet (NerveSimplex FinCat) -> Int+generatedNerveSSetWeight upperBound generatedSet =+ [0 .. upperBound]+ & fmap (nerveSimplicesWeight . generatedSimplicesAtDimension generatedSet) & sum nerveSimplicesWeight :: [NerveSimplex FinCat] -> Int
bench/site/SiteCases.hs view
@@ -9,13 +9,18 @@ ) where +import Data.Bifunctor (first) import Data.Function ((&)) import Data.Map.Strict (Map) import Data.Map.Strict qualified as Map import Data.Set (Set) import Data.Set qualified as Set import FinCat (objectKeys)-import Moonlight.Category.Pure.FinCat (FinObjectId (..))+import Moonlight.Category.Pure.FinCat (FinObjectId, finObjId)+import Moonlight.Category.Pure.Site.Compile+ ( ThinSiteKernel,+ thinSiteFinObject,+ ) import Moonlight.Category.Pure.Site.Core (SiteManifest (..)) import Moonlight.Category.Pure.Site.Graph (reachableClosure) @@ -57,19 +62,13 @@ LinearSite objectCount -> (0, objectCount - 1) LayeredSite width depth -> (layeredNode width 0 0, layeredNode width depth 0) -siteEndpointObjectIds :: SiteCase -> SiteManifest Int -> Either String (FinObjectId, FinObjectId)-siteEndpointObjectIds siteCase manifest =- case (Map.lookup sourceValue objectIds, Map.lookup targetValue objectIds) of- (Just sourceId, Just targetId) -> Right (sourceId, targetId)- _ -> Left ("site endpoint missing from manifest: " <> show (sourceValue, targetValue))+siteEndpointObjectIds :: SiteCase -> ThinSiteKernel validation Int -> Either String (FinObjectId, FinObjectId)+siteEndpointObjectIds siteCase kernel = do+ sourceObject <- first show (thinSiteFinObject kernel sourceValue)+ targetObject <- first show (thinSiteFinObject kernel targetValue)+ pure (finObjId sourceObject, finObjId targetObject) where (sourceValue, targetValue) = siteEndpoints siteCase- objectIds =- siteObjects manifest- & Set.toAscList- & zip (FinObjectId <$> [0 ..])- & fmap (\(objectId, objectValue) -> (objectValue, objectId))- & Map.fromList linearSiteManifest :: Int -> SiteManifest Int linearSiteManifest objectCount =
bench/site/SiteManifest.hs view
@@ -40,8 +40,9 @@ ) import Moonlight.Category.Pure.Site.Compile ( ThinSitePresentation (..),- siteImportsAsFinCat,+ thinSiteImportKernel, thinSiteKernel,+ thinSiteKernelCodomain, thinSitePresentation, ) import Moonlight.Category.Pure.Site.Core@@ -78,10 +79,10 @@ bench "reachableClosure" (nf reachableClosureWeight (siteImports manifest)), bench "importCycles" (nf importCyclesWeight manifest), bench "thinSiteKernel + explicit presentation" (nf thinSitePresentationWeight manifest),- bench "siteImportsAsFinCat constructor" (nf siteImportsAsFinCatConstructorWeight manifest),+ bench "thinSiteImportKernel constructor" (nf thinSiteImportKernelConstructorWeight manifest), env (prepareBenchValue (preparedSiteFinCatCase siteCase manifest)) $ \prepared -> bgroup- "prepared siteImportsAsFinCat"+ "prepared thinSiteImportKernel" [ bench "resident endpoint lookup" (nf preparedSiteFinCatEndpointLookupWeight prepared), bench "resident source incident count" (nf preparedSiteFinCatSourceIncidentCountWeight prepared), bench "resident target incident count" (nf preparedSiteFinCatTargetIncidentCountWeight prepared),@@ -110,8 +111,9 @@ preparedSiteFinCatCase :: SiteCase -> SiteManifest Int -> BenchSetup PreparedSiteFinCatCase preparedSiteFinCatCase siteCase manifest = BenchSetup $ do- categoryValue <- first show (siteImportsAsFinCat manifest)- (sourceId, targetId) <- siteEndpointObjectIds siteCase manifest+ importKernel <- first show (thinSiteImportKernel manifest)+ let categoryValue = thinSiteKernelCodomain importKernel+ (sourceId, targetId) <- siteEndpointObjectIds siteCase importKernel pure PreparedSiteFinCatCase { preparedSiteFinCatCategory = categoryValue,@@ -203,9 +205,12 @@ + morphismMapWeight (thinPresentationMorphisms presentation) + compositionMapWeight (thinPresentationComposition presentation) -siteImportsAsFinCatConstructorWeight :: SiteManifest Int -> Int-siteImportsAsFinCatConstructorWeight manifest =- either siteFinCatErrorWeight (\categoryValue -> finCatHandle categoryValue `seq` 1) (siteImportsAsFinCat manifest)+thinSiteImportKernelConstructorWeight :: SiteManifest Int -> Int+thinSiteImportKernelConstructorWeight manifest =+ either+ siteFinCatErrorWeight+ (\kernel -> finCatHandle (thinSiteKernelCodomain kernel) `seq` 1)+ (thinSiteImportKernel manifest) siteViolationWeight :: SiteViolation Int -> Int siteViolationWeight =
bench/site/SitePathQuotient.hs view
@@ -16,19 +16,23 @@ finMorphismWeight, finObjectIdWeight, )-import Moonlight.Category.Pure.FinCat (FinObjectId)+import Moonlight.Category.Pure.FinCat (finObjId) import Moonlight.Category.Pure.Site.Category ( SitePathCategory, SitePathMorphism, sitePathCategory, sitePathCategoryCodomain,- sitePathCategoryObjectIds,+ sitePathCategoryKernel, sitePathManifest, sitePathMorphismCodomain, sitePathMorphismNodes, sitePathMorphismsBetween, )-import Moonlight.Category.Pure.Site.Compile (thinSiteKernel)+import Moonlight.Category.Pure.Site.Compile+ ( thinSiteFinObject,+ thinSiteKernel,+ thinSiteObjectValue,+ ) import Moonlight.Category.Pure.Site.Core (SiteManifest (..)) import Moonlight.Category.Pure.Site.Quotient ( SitePathQuotient,@@ -36,7 +40,6 @@ sitePathQuotient, sitePathQuotientCodomain, sitePathQuotientDomain,- sitePathQuotientObjectIds, ) import SiteCases ( SiteCase,@@ -58,7 +61,8 @@ env (prepareBenchValue (preparedPathSiteCase siteCase)) $ \prepared -> bgroup (siteCaseLabel siteCase)- [ bench "sitePathMorphismsBetween" (nf preparedPathEnumerationWeight prepared),+ [ bench "site kernel object roundtrip" (nf preparedPathObjectRoundTripWeight prepared),+ bench "sitePathMorphismsBetween" (nf preparedPathEnumerationWeight prepared), bench "sitePathQuotient map morphisms" (nf preparedPathQuotientWeight prepared) ] @@ -103,6 +107,10 @@ & fmap sitePathMorphismWeight & sum +preparedPathObjectRoundTripWeight :: PreparedPathSiteCase -> Int+preparedPathObjectRoundTripWeight prepared =+ sitePathObjectRoundTripWeight (preparedPathCategory prepared)+ preparedPathQuotientWeight :: PreparedPathSiteCase -> Int preparedPathQuotientWeight prepared = sitePathMorphismsBetween@@ -130,14 +138,31 @@ sitePathCategoryDeepWeight categoryValue = siteManifestWeight (sitePathManifest categoryValue) + finCatWeight (sitePathCategoryCodomain categoryValue)- + objectIdMapWeight (sitePathCategoryObjectIds categoryValue)+ + sitePathObjectRoundTripWeight categoryValue sitePathQuotientDeepWeight :: SitePathQuotient Int -> Int sitePathQuotientDeepWeight quotientValue = sitePathCategoryDeepWeight (sitePathQuotientDomain quotientValue) + finCatWeight (sitePathQuotientCodomain quotientValue)- + objectIdMapWeight (sitePathQuotientObjectIds quotientValue) +sitePathObjectRoundTripWeight :: SitePathCategory Int -> Int+sitePathObjectRoundTripWeight categoryValue =+ siteObjects (sitePathManifest categoryValue)+ & Set.toAscList+ & fmap (sitePathObjectRoundTripWeightFor categoryValue)+ & sum++sitePathObjectRoundTripWeightFor :: SitePathCategory Int -> Int -> Int+sitePathObjectRoundTripWeightFor categoryValue objectValue =+ case thinSiteFinObject (sitePathCategoryKernel categoryValue) objectValue of+ Left _ -> 0+ Right finObject ->+ finObjectIdWeight (finObjId finObject)+ + either+ (const 0)+ id+ (thinSiteObjectValue (sitePathCategoryKernel categoryValue) finObject)+ siteManifestWeight :: SiteManifest Int -> Int siteManifestWeight manifest = intSetWeight (siteObjects manifest)@@ -153,14 +178,6 @@ Map.foldlWithKey' ( \accumulated objectValue coveredValues -> accumulated + objectValue + intSetWeight coveredValues- )- 0--objectIdMapWeight :: Map Int FinObjectId -> Int-objectIdMapWeight =- Map.foldlWithKey'- ( \accumulated objectValue objectId ->- accumulated + objectValue + finObjectIdWeight objectId ) 0
moonlight-category.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.4 name: moonlight-category-version: 1.0.0.0+version: 1.1.0.0 homepage: https://github.com/PaleRoses/moonlight bug-reports: https://github.com/PaleRoses/moonlight/issues synopsis: Categorical layer for Pale Meridian.@@ -38,7 +38,7 @@ source-repository this type: git location: https://github.com/PaleRoses/moonlight.git- tag: moonlight-category-1.0.0.0+ tag: moonlight-category-1.1.0.0 subdir: moonlight-category common shared-properties@@ -228,7 +228,7 @@ common category-test-properties import: shared-properties build-depends:- base >= 4.22 && < 5+ base >= 4.20 && < 5 , tasty >= 1.4 && < 1.6 common category-abstract-fixture-slice@@ -253,7 +253,7 @@ , moonlight-category:abstract , moonlight-category:finite , moonlight-category:laws- , moonlight-pale:test >= 0.1 && < 0.2+ , moonlight-pale:test >= 0.1.0.2 && < 0.2 , tasty-hunit >= 0.10 && < 0.11 common category-finite-test-slice@@ -269,7 +269,7 @@ , moonlight-category:abstract , moonlight-category:finite , moonlight-category:laws- , moonlight-pale:test >= 0.1 && < 0.2+ , moonlight-pale:test >= 0.1.0.2 && < 0.2 , tasty-hunit >= 0.10 && < 0.11 , tasty-quickcheck >= 0.10 && < 0.12 , QuickCheck >= 2.14 && < 2.19@@ -330,10 +330,13 @@ common category-facade-test-slice other-modules: FacadeTests+ FacadeSiteNerveSpec NotationSpec build-depends:- moonlight-category- , moonlight-pale:test >= 0.1 && < 0.2+ containers >= 0.6 && < 0.9+ , moonlight-category+ , moonlight-pale:test >= 0.1.0.2 && < 0.2+ , moonlight-category:simplicial , tasty-hunit >= 0.10 && < 0.11 common category-laws-test-slice@@ -408,7 +411,7 @@ import: shared-properties ghc-options: -O2 -rtsopts build-depends:- base >= 4.22 && < 5+ base >= 4.20 && < 5 , tasty-bench >= 0.3 && < 0.6 common category-benchmark-support-slice
src-abstract/Moonlight/Category/Pure/FiniteComposable.hs view
@@ -7,6 +7,7 @@ module Moonlight.Category.Pure.FiniteComposable ( ComposableChain, chainStartObject,+ chainVertices, chainMorphisms, ComposableChainError (..), SizedComposableChain,@@ -25,24 +26,25 @@ import Data.Bifunctor (first) import Control.Monad (foldM)-import Data.Foldable (toList) import Data.Function ((&)) import Data.Kind (Constraint, Type) import Data.List (genericTake)+import Data.List.NonEmpty (NonEmpty (..)) import Data.Maybe (fromMaybe, mapMaybe)-import Data.Sequence (Seq, (|>))-import qualified Data.Sequence as Seq import Numeric.Natural (Natural) import Moonlight.Category.Pure.Category (Category (..)) type ComposableChain :: Type -> Type--- | A path whose adjacent morphism endpoints have been validated.+-- | A path whose adjacent morphism endpoints have been validated. Every stored+-- step carries the target established while appending it, so vertex projection+-- is total and never has to query the category again. The terminal object is+-- an O(1) view of the newest step; the strict finite step count is an opaque+-- cache with the same representable domain as the previous sequence-length+-- view. data ComposableChain c = ComposableChain- { -- | The path's source object.- chainStartObject :: Ob c,- -- | The path's current target object.- chainTerminalObject :: Ob c,- chainMorphismSequence :: Seq (Mor c)+ { chainStartObjectInternal :: Ob c,+ chainStepCountInternal :: !Int,+ chainValidatedStepsNewestFirst :: [(Mor c, Ob c)] } type SizedComposableChain :: Type -> Type@@ -63,16 +65,44 @@ -- | Count the morphisms in a validated path. chainDimension :: ComposableChain c -> Natural-chainDimension = fromIntegral . Seq.length . chainMorphismSequence+chainDimension = fromIntegral . chainStepCountInternal+{-# INLINE chainDimension #-} +-- | The first vertex of a validated path.+chainStartObject :: ComposableChain c -> Ob c+chainStartObject = chainStartObjectInternal+{-# INLINE chainStartObject #-}++-- | The terminal vertex of a validated path.+chainTerminalObject :: ComposableChain c -> Ob c+chainTerminalObject chainValue =+ case chainValidatedStepsNewestFirst chainValue of+ [] -> chainStartObjectInternal chainValue+ (_, terminalObject) : _ -> terminalObject+{-# INLINE chainTerminalObject #-}++-- | The nonempty vertex sequence established by chain construction, in path+-- order. Its final vertex is 'chainTerminalObject'.+chainVertices :: ComposableChain c -> NonEmpty (Ob c)+chainVertices chainValue =+ chainStartObjectInternal chainValue+ :| foldl'+ (\targets (_, targetObject) -> targetObject : targets)+ []+ (chainValidatedStepsNewestFirst chainValue)+ -- | Project the morphisms in composition order. chainMorphisms :: ComposableChain c -> [Mor c]-chainMorphisms = toList . chainMorphismSequence+chainMorphisms chainValue =+ foldl'+ (\morphisms (morphism, _) -> morphism : morphisms)+ []+ (chainValidatedStepsNewestFirst chainValue) -- | The dimension-zero path at an object. singletonComposableChain :: Ob c -> ComposableChain c singletonComposableChain objectValue =- ComposableChain objectValue objectValue Seq.empty+ ComposableChain objectValue 0 [] -- | Validate a morphism sequence from a declared start object. mkComposableChain :: (Category c, Eq (Ob c)) => c -> Ob c -> [Mor c] -> Either (ComposableChainError c) (ComposableChain c)@@ -92,15 +122,16 @@ appendComposableMorphism categoryValue chainValue morphism = do morphismSource <- first ComposableChainCategoryError (source categoryValue morphism) morphismTarget <- first ComposableChainCategoryError (target categoryValue morphism)- if morphismSource == chainTerminalObject chainValue+ let terminalObject = chainTerminalObject chainValue+ if morphismSource == terminalObject then Right ComposableChain- { chainStartObject = chainStartObject chainValue,- chainTerminalObject = morphismTarget,- chainMorphismSequence = chainMorphismSequence chainValue |> morphism+ { chainStartObjectInternal = chainStartObjectInternal chainValue,+ chainStepCountInternal = chainStepCountInternal chainValue + 1,+ chainValidatedStepsNewestFirst = (morphism, morphismTarget) : chainValidatedStepsNewestFirst chainValue }- else Left (ComposableChainEndpointMismatch (chainTerminalObject chainValue) morphismSource)+ else Left (ComposableChainEndpointMismatch terminalObject morphismSource) -- | Enumerate all composable paths at one exact dimension. chainsOfDimension :: FiniteComposableCategory c => c -> Natural -> [ComposableChain c]
src-laws/Moonlight/Category/Effect/Harness/Site.hs view
@@ -14,10 +14,13 @@ import Moonlight.Category.Pure.Site ( SiteManifest, SiteViolation (..),- siteImportsAsFinCat, siteImportEdges, validateSiteManifest, )+import Moonlight.Category.Pure.Site.Compile+ ( thinSiteImportKernel,+ thinSiteKernelCodomain,+ ) import Prelude hiding (Functor) mkSiteLaws :: forall obj layer. Ord obj => SiteLaws obj layer@@ -43,20 +46,22 @@ siteCategoryIdentityLaw :: forall obj. Ord obj => SiteManifest obj -> Bool siteCategoryIdentityLaw manifest =- case siteImportsAsFinCat manifest of+ case thinSiteImportKernel manifest of Left _ -> False- Right finCategory ->- let morphisms = allMorphisms finCategory+ Right importKernel ->+ let finCategory = thinSiteKernelCodomain importKernel+ morphisms = allMorphisms finCategory laws = mkCategoryLaws @FinCat finCategory in all (categoryLeftIdentity laws) morphisms && all (categoryRightIdentity laws) morphisms siteCategoryAssociativityLaw :: forall obj. Ord obj => SiteManifest obj -> Bool siteCategoryAssociativityLaw manifest =- case siteImportsAsFinCat manifest of+ case thinSiteImportKernel manifest of Left _ -> False- Right finCategory ->- let morphisms = allMorphisms finCategory+ Right importKernel ->+ let finCategory = thinSiteKernelCodomain importKernel+ morphisms = allMorphisms finCategory laws = mkCategoryLaws @FinCat finCategory in [ (firstValue, secondValue, thirdValue) | firstValue <- morphisms,
src-laws/Moonlight/Category/Effect/Laws/Site.hs view
@@ -30,7 +30,6 @@ pathThinCodomainObject, quotientPathThinMorphism, quotientPathThinObject,- siteImportsAsFinCat, sitePathCategory, sitePathManifest, sitePathMorphismsBetween,@@ -38,6 +37,10 @@ thinSiteKernel, thinSitePresentation, )+import Moonlight.Category.Pure.Site.Compile+ ( thinSiteImportKernel,+ thinSiteKernelCodomain,+ ) import Moonlight.Pale.Test.Laws.Suite (LawSuite, lawGroup, namedQuickCheckLaw) sampleSiteManifest :: SiteManifest Int@@ -98,15 +101,16 @@ thinSiteFinCatGenericAgreementLaw :: Bool thinSiteFinCatGenericAgreementLaw =- case (siteImportsAsFinCat diamondManifest, thinSiteKernel diamondManifest) of- (Right thinDerived, Right kernel) ->+ case (thinSiteImportKernel diamondManifest, thinSiteKernel diamondManifest) of+ (Right importKernel, Right kernel) -> case thinPresentationToFinCat (thinSitePresentation kernel) of Left _ -> False Right genericallyChecked ->- thinDerived == genericallyChecked- && finCatObjects thinDerived == finCatObjects genericallyChecked- && finCatExplicitMorphismMapView thinDerived == finCatExplicitMorphismMapView genericallyChecked- && finCatExplicitCompositionMapView thinDerived == finCatExplicitCompositionMapView genericallyChecked+ let thinDerived = thinSiteKernelCodomain importKernel+ in thinDerived == genericallyChecked+ && finCatObjects thinDerived == finCatObjects genericallyChecked+ && finCatExplicitMorphismMapView thinDerived == finCatExplicitMorphismMapView genericallyChecked+ && finCatExplicitCompositionMapView thinDerived == finCatExplicitCompositionMapView genericallyChecked _ -> False siteQuotientIdentityLaw :: SitePathCategory Int -> Bool@@ -136,10 +140,11 @@ pathThinCodomainIdentityLaw :: SitePathCategory Int -> Bool pathThinCodomainIdentityLaw category =- case siteImportsAsFinCat (sitePathManifest category) of+ case thinSiteImportKernel (sitePathManifest category) of Left _ -> False- Right finCategory ->- let thinCategory = pathThinCat category+ Right importKernel ->+ let finCategory = thinSiteKernelCodomain importKernel+ thinCategory = pathThinCat category in all ( \sitePathObject -> let objectValue = quotientPathThinObject sitePathObject@@ -151,10 +156,11 @@ pathThinCodomainCompositionLaw :: SitePathCategory Int -> Bool pathThinCodomainCompositionLaw category =- case siteImportsAsFinCat (sitePathManifest category) of+ case thinSiteImportKernel (sitePathManifest category) of Left _ -> False- Right finCategory ->- let thinCategory = pathThinCat category+ Right importKernel ->+ let finCategory = thinSiteKernelCodomain importKernel+ thinCategory = pathThinCat category in all ( \(leftValue, rightValue) -> case compose thinCategory leftValue rightValue of
src-public/Moonlight/Category.hs view
@@ -19,6 +19,25 @@ already-compiled finite category, import "Moonlight.Category.Notation". The indexed, typed-arrow layer is exposed separately as "Moonlight.Category.Indexed".++== Ordinary consumer path++This facade owns ordinary site compilation and finite-category provenance.+'thinSiteImportKernel' validates and compiles just the import category, while+'thinSiteKernel' additionally establishes the cover axioms required by the full+site/path layer. Keep the resulting 'ThinSiteKernel' with its codomain: a+site-derived 'FinObjectId' is a kernel-relative representation token, /not/ a+semantic name or a stable numeric ordering. Recover source objects through+'thinSiteFinObject' and 'thinSiteObjectValue', never by rebuilding an identifier+map from the manifest's object set.++'ComposableChain' is opaque and validated at construction. Its 'chainVertices'+projection is therefore total: the established endpoint evidence is retained rather+than queried again. For a nerve, add the separate+"Moonlight.Category.Simplicial" component and import its facade. Its+@normalizedNerve@ is the ordinary nonidentity-chain construction;+@unnormalizedNerve@ intentionally materializes identity insertions as well and can+grow combinatorially even for a modest truncation bound. -} module Moonlight.Category ( UnitCat (..),@@ -45,7 +64,7 @@ import Moonlight.Category.Pure.PolynomialFunctor as X import Moonlight.Category.Pure.Limits as X import Moonlight.Category.Pure.StructuredCospan as X-import Moonlight.Category.Pure.Site as X+import Moonlight.Category.Pure.Site as X hiding (ThinSitePresentation (..), thinPresentationToFinCat, thinSitePresentation) import Moonlight.Category.Pure.Unit ( UnitCat (..), UnitMor (..),
src-simplicial/Moonlight/Category/Pure/Simplicial/Nerve.hs view
@@ -3,7 +3,10 @@ {-# LANGUAGE UndecidableInstances #-} -- | The nerve of a finite composable category: simplices are composable chains,--- with face and degeneracy structure.+-- with face and degeneracy structure. 'normalizedNerve' is the ordinary+-- nonidentity-chain construction. 'unnormalizedNerve' materializes every+-- composable chain, including identity insertions, and therefore has a+-- substantially larger cost surface. module Moonlight.Category.Pure.Simplicial.Nerve ( NerveSimplex, nerveSimplexDimension,@@ -13,12 +16,11 @@ Nerve, nerveCategory, unNerve,- nerveGenerated,+ unnormalizedNerve, isNerveSimplexDegenerate, nerveSimplexFace, nerveSimplexDegeneracy,- nerveChainVertices,- nerve,+ normalizedNerve, nerveInnerKan, fillNerveInnerHorn, fillNerveInnerHornIndexed,@@ -30,6 +32,7 @@ import Data.Function ((&)) import Data.Kind (Type) import Data.List (genericLength, genericSplitAt, unsnoc)+import Data.List.NonEmpty qualified as NonEmpty import Data.Maybe (mapMaybe) import Data.Map.Strict qualified as Map import GHC.TypeNats (KnownNat, type (+))@@ -41,6 +44,7 @@ chainDimension, chainMorphisms, chainStartObject,+ chainVertices, mkComposableChain, sizedChainDimension, sizedChainValue,@@ -102,12 +106,16 @@ chainMorphisms (nerveSimplexChain simplexValue) & any (morphismIsIdentity categoryValue) -nerveGenerated ::+-- | Materialize the unnormalized nerve through the supplied dimension. This+-- includes every identity insertion, so it is intended only for small+-- diagnostic or law workloads. The dimension bound is /not/ a resource bound:+-- the number of composable chains can grow combinatorially before that bound.+unnormalizedNerve :: (FiniteComposableCategory c, Ord (Ob c), Ord (Mor c)) => c -> Natural -> GeneratedSSet (NerveSimplex c)-nerveGenerated categoryValue upperBound =+unnormalizedNerve categoryValue upperBound = let levelMap = Map.fromAscListWith (<>) (nerveLevels categoryValue upperBound) in trustedGeneratedSSetWithWitness upperBound@@ -116,12 +124,17 @@ (nerveDegeneracy categoryValue) (isNerveSimplexDegenerate categoryValue) -nerve ::+-- | Construct the normalized nerve through the supplied dimension by+-- enumerating nonidentity chains and closing them under faces. This is the+-- default construction for topological and combinatorial queries. Its+-- dimension bound selects simplices; it does not promise a fixed time or memory+-- budget for an arbitrary finite category.+normalizedNerve :: (FiniteComposableCategory c, Ord (Ob c), Ord (Mor c)) => c -> Natural -> TruncatedNormalizedSSet (NerveSimplex c)-nerve categoryValue upperBound =+normalizedNerve categoryValue upperBound = normalizeGeneratedSSet ( trustedGeneratedSSetWithWitness upperBound@@ -147,7 +160,7 @@ c -> Natural -> Nerve c-nerveInnerKan categoryValue upperBound = Nerve categoryValue (nerve categoryValue upperBound)+nerveInnerKan categoryValue upperBound = Nerve categoryValue (normalizedNerve categoryValue upperBound) nerveLevels :: (FiniteComposableCategory c, Ord (Ob c), Ord (Mor c)) => c -> Natural -> [(Natural, [NerveSimplex c])] nerveLevels categoryValue upperBound =@@ -300,10 +313,6 @@ degeneracyChainValue <- degeneracyChain categoryValue degeneracyIndex (nerveSimplexChain simplexValue) pure (NerveSimplex (currentDimension + 1) degeneracyChainValue) -nerveChainVertices :: Category c => c -> ComposableChain c -> Either (CategoryError c) [Ob c]-nerveChainVertices categoryValue chainValue =- fmap (chainStartObject chainValue :) (traverse (target categoryValue) (chainMorphisms chainValue))- splitAtNatural :: Natural -> [a] -> Maybe ([a], [a]) splitAtNatural splitIndex values = let (prefix, suffix) = genericSplitAt splitIndex values@@ -321,9 +330,9 @@ | faceIndex > dimensionValue' = Nothing | otherwise = case morphisms of [] -> Nothing- firstMorphism : restMorphisms+ _ : restMorphisms | faceIndex == 0 -> do- startObject <- either (const Nothing) Just (target categoryValue firstMorphism)+ startObject <- safeIndexNatural 1 (NonEmpty.toList (chainVertices chainValue)) either (const Nothing) Just (mkComposableChain categoryValue startObject restMorphisms) | faceIndex == dimensionValue' -> do (prefixMorphisms, _) <- unsnoc morphisms@@ -353,8 +362,7 @@ in if degeneracyIndex > dimensionValue' then Nothing else do- vertices <- either (const Nothing) Just (nerveChainVertices categoryValue chainValue)- duplicatedObject <- safeIndexNatural degeneracyIndex vertices+ duplicatedObject <- safeIndexNatural degeneracyIndex (NonEmpty.toList (chainVertices chainValue)) identityMorphism <- either (const Nothing) Just (identity categoryValue duplicatedObject) insertedMorphisms <- insertAt degeneracyIndex identityMorphism (chainMorphisms chainValue) either (const Nothing) Just (mkComposableChain categoryValue (chainStartObject chainValue) insertedMorphisms)
src-simplicial/Moonlight/Category/Simplicial.hs view
@@ -4,6 +4,20 @@ @simplicial@ sublibrary without making downstream consumers name its @Pure.Simplicial@ implementation paths. The effectful property harness remains in @moonlight-category:laws@.++== Cabal boundary and nerve cost++This module is provided by the public @moonlight-category:simplicial@ component;+programs using site compilation and simplicial constructions should depend on that+component alongside @moonlight-category@ and import this facade alongside+"Moonlight.Category". That pair is the complete ordinary consumer path.++'normalizedNerve' is the default: it enumerates nonidentity chains and closes them+under faces. 'unnormalizedNerve' instead materializes every composable chain,+including identity insertions, and is intended only for small diagnostic or law+workloads. Its dimension bound is not a resource bound. Validated chain vertices+are available totally as 'chainVertices' from "Moonlight.Category"; use the site+kernel's inverse lookup there to recover domain object names. -} module Moonlight.Category.Simplicial ( module CategoricalSimplex,
src-site/Moonlight/Category/Pure/Site.hs view
@@ -5,7 +5,10 @@ ( SiteManifest (..), SiteViolation (..), SiteFinCatError (..),+ ThinSiteValidation (..), ThinSiteKernel,+ ThinSiteLookupError (..),+ ThinSiteObjectValueError (..), ThinSitePresentation (..), SitePathCategory, SitePathObject,@@ -17,7 +20,14 @@ SitePathQuotientError (..), mkSiteManifest, validateSiteManifest,+ thinSiteImportKernel, thinSiteKernel,+ thinSiteKernelManifest,+ thinSiteKernelCodomain,+ thinSiteFinObject,+ thinSiteObjectValue,+ thinSiteFinMorphism,+ thinSiteFinMorphismByEndpoints, thinSitePresentation, thinPresentationToFinCat, sitePathCategory,@@ -35,7 +45,6 @@ sitePathQuotient, quotientMapObject, quotientMapMorphism,- siteImportsAsFinCat, siteImportEdges, siteReachable, )@@ -43,11 +52,20 @@ import Moonlight.Category.Pure.Site.Category as X import Moonlight.Category.Pure.Site.Compile as X- ( ThinSiteKernel,+ ( ThinSiteValidation (..),+ ThinSiteKernel,+ ThinSiteLookupError (..),+ ThinSiteObjectValueError (..), ThinSitePresentation (..),- siteImportsAsFinCat, thinPresentationToFinCat,+ thinSiteFinMorphism,+ thinSiteFinMorphismByEndpoints,+ thinSiteFinObject,+ thinSiteImportKernel, thinSiteKernel,+ thinSiteKernelCodomain,+ thinSiteKernelManifest,+ thinSiteObjectValue, thinSitePresentation, ) import Moonlight.Category.Pure.Site.Core as X
src-site/Moonlight/Category/Pure/Site/Category.hs view
@@ -1,5 +1,7 @@--- | The path category of a site: objects, morphisms-as-paths, and enumeration of the--- morphisms between two objects.+{-# LANGUAGE DataKinds #-}++-- | The path category of a fully validated site: objects, morphisms-as-paths,+-- and enumeration of the morphisms between two objects. module Moonlight.Category.Pure.Site.Category ( SitePathCategory, SitePathObject,@@ -7,7 +9,6 @@ sitePathCategory, sitePathCategoryKernel, sitePathCategoryCodomain,- sitePathCategoryObjectIds, sitePathManifest, sitePathObjectCategory, sitePathObjectValue,@@ -26,7 +27,6 @@ import Data.Function ((&)) import Data.List.NonEmpty (NonEmpty (..)) import qualified Data.List.NonEmpty as NonEmpty-import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map import Data.Maybe (mapMaybe) import qualified Data.Set as Set@@ -36,24 +36,23 @@ ( FinCat, FinCatError, FinMor,- FinObjectId, FinObj, ) import Moonlight.Core qualified as Aggregate import Moonlight.Category.Pure.Site.Compile ( ThinSiteKernel,+ ThinSiteValidation (SiteValidated), thinSiteFinMorphism, thinSiteFinObject, thinSiteKernelCodomain, thinSiteKernelManifest,- thinSiteKernelObjectIds, ) import Moonlight.Category.Pure.Site.Core (SiteManifest (..)) import Moonlight.Category.Pure.Site.Graph (siteImportEdges) type SitePathCategory :: Type -> Type newtype SitePathCategory obj = SitePathCategory- { sitePathCategoryKernel :: ThinSiteKernel obj+ { sitePathCategoryKernel :: ThinSiteKernel 'SiteValidated obj } deriving stock (Eq, Show) @@ -90,14 +89,11 @@ | SitePathCodomainError FinCatError deriving stock (Eq, Show) -sitePathCategory :: ThinSiteKernel obj -> SitePathCategory obj+sitePathCategory :: ThinSiteKernel 'SiteValidated obj -> SitePathCategory obj sitePathCategory = SitePathCategory sitePathCategoryCodomain :: SitePathCategory obj -> FinCat sitePathCategoryCodomain = thinSiteKernelCodomain . sitePathCategoryKernel--sitePathCategoryObjectIds :: SitePathCategory obj -> Map obj FinObjectId-sitePathCategoryObjectIds = thinSiteKernelObjectIds . sitePathCategoryKernel sitePathManifest :: SitePathCategory obj -> SiteManifest obj sitePathManifest = thinSiteKernelManifest . sitePathCategoryKernel
src-site/Moonlight/Category/Pure/Site/Compile.hs view
@@ -1,19 +1,24 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE RoleAnnotations #-}+ -- | Compilation of a thin site presentation to a runtime-validated finite category,--- with object and morphism lookup.+-- with kernel-relative object and morphism lookup. module Moonlight.Category.Pure.Site.Compile- ( ThinSitePresentation (..),+ ( ThinSiteValidation (..), ThinSiteKernel, thinSiteKernelManifest, thinSiteKernelCodomain,- thinSiteKernelObjectIds, ThinSiteLookupError (..),+ ThinSiteObjectValueError (..),+ ThinSitePresentation (..), thinSitePresentation, thinPresentationToFinCat,+ thinSiteImportKernel, thinSiteKernel, thinSiteFinObject,+ thinSiteObjectValue, thinSiteFinMorphism, thinSiteFinMorphismByEndpoints,- siteImportsAsFinCat, ) where @@ -30,6 +35,7 @@ import Moonlight.Category.Pure.Category (Category (identity)) import Moonlight.Category.Pure.FinCat ( FinCat,+ FinCatHandle, FinCatError, FinCatValidationError, FinMor,@@ -41,12 +47,16 @@ mkFinObject, denseThinEndpointMorphismsFromCategory, finCatExplicitCompositionMapView,+ finCatHandle, finCatMorphismIdByEndpoints,+ finObjCategoryHandle,+ finObjId, trustedDenseThinFinCatFromReachabilityRows, )-import Moonlight.Category.Pure.Site.Core (SiteFinCatError (..), SiteManifest)+import Moonlight.Category.Pure.Site.Core (SiteFinCatError (..), SiteManifest, SiteViolation) import Moonlight.Category.Pure.Site.Manifest- ( validateSiteImportManifest,+ ( ValidatedSiteManifest,+ validateSiteImportManifest, validateSiteManifestDetailed, validatedSiteObjectVector, validatedSiteReachabilityRows,@@ -61,11 +71,33 @@ thinPresentationComposition :: Map (FinMorphismId, FinMorphismId) FinMorphismId } -type ThinSiteKernel :: Type -> Type-data ThinSiteKernel obj = ThinSiteKernel+-- | The validation obligation discharged before compiling a 'ThinSiteKernel'.+--+-- An import kernel validates only the import graph. A site kernel additionally+-- proves the cover axioms required by path and quotient construction.+type ThinSiteValidation :: Type+data ThinSiteValidation+ = ImportsValidated+ | SiteValidated+ deriving stock (Eq, Show)++-- | A finite import category together with the exact manifest-local+-- correspondence between semantic objects and its opaque finite objects.+--+-- 'FinObjectId' values produced here are representation tokens relative to this+-- kernel, not semantic object names or a stable ordering contract. Use+-- 'thinSiteFinObject' and 'thinSiteObjectValue' rather than reconstructing the+-- ascending-set enumeration.+--+-- The validation index is nominal: an import-only kernel cannot be coerced into+-- the full-site evidence required by path and quotient construction.+type ThinSiteKernel :: ThinSiteValidation -> Type -> Type+type role ThinSiteKernel nominal nominal+data ThinSiteKernel validation obj = ThinSiteKernel { thinSiteKernelManifest :: SiteManifest obj, thinSiteKernelCodomain :: FinCat,- thinSiteKernelObjectIds :: Map obj FinObjectId+ thinSiteKernelObjectIds :: Map obj FinObjectId,+ thinSiteKernelObjectValues :: Vector.Vector obj } deriving stock (Eq, Show) @@ -78,15 +110,26 @@ | ThinSiteCodomainMorphismInvalid FinCatError deriving stock (Eq, Show) +-- | Obstructions specific to inverting a finite object through a site kernel.+--+-- These are intentionally distinct from 'ThinSiteLookupError': callers that+-- only construct finite objects or morphisms do not acquire impossible inverse+-- lookup cases in their error algebra.+type ThinSiteObjectValueError :: Type+data ThinSiteObjectValueError+ = ThinSiteForeignCodomainObject FinCatHandle FinCatHandle FinObjectId+ | ThinSiteUnmappedCodomainObject FinObjectId+ deriving stock (Eq, Show)+ -- | Builds the explicit presentation, including the materialized composition -- table via 'finCatExplicitCompositionMapView' — an output-bound @Θ(n³)@ witness -- for a linear site on @n@ objects, dominating the @Θ(n²/w)@ dense validation -- that precedes it. The record fields are lazy, so the cubic table is only paid -- when 'thinPresentationComposition' is forced. Callers that need composition--- queries rather than the explicit witness should use 'thinSiteKernel', which+-- queries rather than the explicit witness should use a 'ThinSiteKernel', which -- stays on the dense handle and answers composition in -- @O(1)@ without materializing.-thinSitePresentation :: ThinSiteKernel obj -> ThinSitePresentation obj+thinSitePresentation :: ThinSiteKernel validation obj -> ThinSitePresentation obj thinSitePresentation kernel = let objectIds = thinSiteKernelObjectIds kernel codomain = thinSiteKernelCodomain kernel@@ -141,25 +184,49 @@ (thinPresentationMorphisms presentation) (thinPresentationComposition presentation) -thinSiteKernel :: Ord obj => SiteManifest obj -> Either (SiteFinCatError obj) (ThinSiteKernel obj)-thinSiteKernel manifest =- case validateSiteManifestDetailed manifest of+-- | Compile the import category while deliberately leaving cover validation+-- outside the obligation. The resulting kernel cannot construct a+-- 'SitePathCategory' or a 'SitePathQuotient'.+thinSiteImportKernel :: Ord obj => SiteManifest obj -> Either (SiteFinCatError obj) (ThinSiteKernel 'ImportsValidated obj)+thinSiteImportKernel =+ compileThinSiteKernel validateSiteImportManifest++-- | Compile a full site kernel after validating both imports and cover axioms.+thinSiteKernel :: Ord obj => SiteManifest obj -> Either (SiteFinCatError obj) (ThinSiteKernel 'SiteValidated obj)+thinSiteKernel =+ compileThinSiteKernel validateSiteManifestDetailed++compileThinSiteKernel ::+ Ord obj =>+ (SiteManifest obj -> Either (NonEmpty (SiteViolation obj)) (ValidatedSiteManifest obj)) ->+ SiteManifest obj ->+ Either (SiteFinCatError obj) (ThinSiteKernel validation obj)+compileThinSiteKernel validateManifest manifest =+ case validateManifest manifest of+ Left errors -> Left (SiteManifestInvalid errors) Right validatedManifest ->- let objectIds = thinSiteObjectIds (Vector.toList (validatedSiteObjectVector validatedManifest))- codomain =- trustedDenseThinFinCatFromReachabilityRows- (thinSiteFinObjectSet objectIds)- (validatedSiteReachabilityRows validatedManifest)- in Right- ThinSiteKernel- { thinSiteKernelManifest = manifest,- thinSiteKernelCodomain = codomain,- thinSiteKernelObjectIds = objectIds- }- Left errors ->- Left (SiteManifestInvalid errors)+ Right (thinSiteKernelFromValidatedManifest manifest validatedManifest) -thinSiteFinObject :: Ord obj => ThinSiteKernel obj -> obj -> Either (ThinSiteLookupError obj) FinObj+thinSiteKernelFromValidatedManifest ::+ Ord obj =>+ SiteManifest obj ->+ ValidatedSiteManifest obj ->+ ThinSiteKernel validation obj+thinSiteKernelFromValidatedManifest manifest validatedManifest =+ let objectValues = validatedSiteObjectVector validatedManifest+ objectIds = thinSiteObjectIds (Vector.toList objectValues)+ codomain =+ trustedDenseThinFinCatFromReachabilityRows+ (thinSiteFinObjectSet objectIds)+ (validatedSiteReachabilityRows validatedManifest)+ in ThinSiteKernel+ { thinSiteKernelManifest = manifest,+ thinSiteKernelCodomain = codomain,+ thinSiteKernelObjectIds = objectIds,+ thinSiteKernelObjectValues = objectValues+ }++thinSiteFinObject :: Ord obj => ThinSiteKernel validation obj -> obj -> Either (ThinSiteLookupError obj) FinObj thinSiteFinObject kernel objectValue = case Map.lookup objectValue (thinSiteKernelObjectIds kernel) of Nothing ->@@ -171,7 +238,30 @@ Right finObject -> Right finObject -thinSiteFinMorphism :: Ord obj => ThinSiteKernel obj -> NonEmpty obj -> Either (ThinSiteLookupError obj) FinMor+-- | Recover the semantic manifest object for an object from this kernel's+-- codomain. The category-handle check rejects objects from a different finite+-- category; a correctly handled object without an entry is reported as an+-- explicit unmapped-codomain obstruction rather than silently reusing its+-- numeric identifier.+thinSiteObjectValue :: ThinSiteKernel validation obj -> FinObj -> Either ThinSiteObjectValueError obj+thinSiteObjectValue kernel finObject+ | finObjCategoryHandle finObject /= expectedHandle =+ Left+ ( ThinSiteForeignCodomainObject+ expectedHandle+ (finObjCategoryHandle finObject)+ (finObjId finObject)+ )+ | otherwise =+ case finObjId finObject of+ objectId@(FinObjectId objectIndex) ->+ case thinSiteKernelObjectValues kernel Vector.!? objectIndex of+ Nothing -> Left (ThinSiteUnmappedCodomainObject objectId)+ Just objectValue -> Right objectValue+ where+ expectedHandle = finCatHandle (thinSiteKernelCodomain kernel)++thinSiteFinMorphism :: Ord obj => ThinSiteKernel validation obj -> NonEmpty obj -> Either (ThinSiteLookupError obj) FinMor thinSiteFinMorphism kernel nodes = thinSiteFinMorphismByEndpoints kernel@@ -180,7 +270,7 @@ thinSiteFinMorphismByEndpoints :: Ord obj =>- ThinSiteKernel obj ->+ ThinSiteKernel validation obj -> obj -> obj -> Either (ThinSiteLookupError obj) FinMor@@ -200,23 +290,8 @@ Right finMorphism -> Right finMorphism -thinSiteMorphismIdByEndpoints :: Ord obj => ThinSiteKernel obj -> obj -> obj -> Maybe FinMorphismId+thinSiteMorphismIdByEndpoints :: Ord obj => ThinSiteKernel validation obj -> obj -> obj -> Maybe FinMorphismId thinSiteMorphismIdByEndpoints kernel sourceValue targetValue = do sourceId <- Map.lookup sourceValue (thinSiteKernelObjectIds kernel) targetId <- Map.lookup targetValue (thinSiteKernelObjectIds kernel) finCatMorphismIdByEndpoints (thinSiteKernelCodomain kernel) sourceId targetId---- | Compile only the import category. Cover axioms are deliberately outside this--- boundary; use 'thinSiteKernel' when a validated site is required.-siteImportsAsFinCat :: Ord obj => SiteManifest obj -> Either (SiteFinCatError obj) FinCat-siteImportsAsFinCat manifest =- case validateSiteImportManifest manifest of- Right validatedManifest ->- let objectIds = thinSiteObjectIds (Vector.toList (validatedSiteObjectVector validatedManifest))- in Right- ( trustedDenseThinFinCatFromReachabilityRows- (thinSiteFinObjectSet objectIds)- (validatedSiteReachabilityRows validatedManifest)- )- Left errors ->- Left (SiteManifestInvalid errors)
src-site/Moonlight/Category/Pure/Site/Quotient.hs view
@@ -1,5 +1,7 @@--- | The path-thin quotient of a site path category: quotient objects and morphisms,--- and the quotient maps from the path category.+{-# LANGUAGE DataKinds #-}++-- | The path-thin quotient of a fully validated site path category: quotient+-- objects and morphisms, and the quotient maps from the path category. module Moonlight.Category.Pure.Site.Quotient ( PathThinCat (..), PathThinObject (..),@@ -7,7 +9,6 @@ SitePathQuotient, sitePathQuotientDomain, sitePathQuotientCodomain,- sitePathQuotientObjectIds, SitePathQuotientError (..), pathThinCat, mkPathThinObject,@@ -25,7 +26,6 @@ import Data.Kind (Type) import Data.Bifunctor (first) import qualified Data.List.NonEmpty as NonEmpty-import Data.Map.Strict (Map) import Moonlight.Category.Pure.Category (Category (..)) import Moonlight.Category.Pure.FinCat ( FinCat,@@ -41,7 +41,6 @@ mkSitePathObject, sitePathCategoryCodomain, sitePathCategoryKernel,- sitePathCategoryObjectIds, sitePathManifest, sitePathMorphismCategory, sitePathMorphismCodomain,@@ -52,6 +51,7 @@ ) import Moonlight.Category.Pure.Site.Compile ( ThinSiteKernel,+ ThinSiteValidation (SiteValidated), ThinSiteLookupError (..), thinSiteFinMorphismByEndpoints, thinSiteFinObject,@@ -116,9 +116,6 @@ sitePathQuotientCodomain :: SitePathQuotient obj -> FinCat sitePathQuotientCodomain = sitePathCategoryCodomain . sitePathQuotientDomain -sitePathQuotientObjectIds :: SitePathQuotient obj -> Map obj FinObjectId-sitePathQuotientObjectIds = sitePathCategoryObjectIds . sitePathQuotientDomain- type SitePathQuotientError :: Type -> Type data SitePathQuotientError obj = QuotientUnknownObject obj@@ -298,7 +295,7 @@ pathThinObjectCodomain = codomainObject } -sitePathQuotientKernel :: SitePathQuotient obj -> ThinSiteKernel obj+sitePathQuotientKernel :: SitePathQuotient obj -> ThinSiteKernel 'SiteValidated obj sitePathQuotientKernel = sitePathCategoryKernel . sitePathQuotientDomain fromThinSiteLookupError :: ThinSiteLookupError obj -> SitePathQuotientError obj
test/abstract/FiniteComposableSpec.hs view
@@ -3,6 +3,7 @@ ) where +import Data.List.NonEmpty qualified as NonEmpty import Moonlight.Category.Pure.Category (Category (..)) import Moonlight.Category.Effect.Fixture.FinCat (sampleFinCat) import Moonlight.Category.Pure.FinCat@@ -16,7 +17,9 @@ chainDimension, chainMorphisms, chainTerminalObject,+ chainVertices, mkComposableChain,+ singletonComposableChain, ) import Moonlight.Pale.Test.Assertions (expectRightWithLabel, expectSome) import Test.Tasty (TestTree, testGroup)@@ -26,7 +29,7 @@ tests = testGroup "FiniteComposable"- [ testCase "checked chains cache their terminal without changing their morphisms" testCheckedChain,+ [ testCase "checked chains retain a total vertex sequence" testCheckedChain, testCase "Natural dimension bounds do not overflow through Int" testNaturalDimensionBound, testCase "identity construction requires a validated object" testCheckedIdentity ]@@ -34,6 +37,7 @@ testCheckedChain :: Assertion testCheckedChain = do object0 <- expectRightWithLabel "object 0" (mkFinObject sampleFinCat (FinObjectId 0))+ object1 <- expectRightWithLabel "object 1" (mkFinObject sampleFinCat (FinObjectId 1)) object2 <- expectRightWithLabel "object 2" (mkFinObject sampleFinCat (FinObjectId 2)) morphism01 <- expectSome "morphism 0 -> 1" (finCatHomMorphism sampleFinCat (FinObjectId 0) (FinObjectId 1)) morphism12 <- expectSome "morphism 1 -> 2" (finCatHomMorphism sampleFinCat (FinObjectId 1) (FinObjectId 2))@@ -43,6 +47,10 @@ chainDimension chainValue @?= 2 chainTerminalObject chainValue @?= object2 chainMorphisms chainValue @?= [morphism01, morphism12]+ chainVertices chainValue @?= object0 NonEmpty.:| [object1, object2]+ NonEmpty.last (chainVertices chainValue) @?= chainTerminalObject chainValue+ NonEmpty.length (chainVertices chainValue) @?= 3+ chainVertices (singletonComposableChain object0) @?= object0 NonEmpty.:| [] testNaturalDimensionBound :: Assertion testNaturalDimensionBound =
+ test/facade/FacadeSiteNerveSpec.hs view
@@ -0,0 +1,70 @@+module FacadeSiteNerveSpec+ ( tests,+ )+where++import Data.List.NonEmpty (NonEmpty (..))+import qualified Data.Map.Strict as Map+import qualified Data.Set as Set+import Moonlight.Category+ ( SiteManifest (..),+ chainVertices,+ thinSiteImportKernel,+ thinSiteKernelCodomain,+ thinSiteObjectValue,+ )+import Moonlight.Category.Simplicial+ ( nerveSimplexChain,+ normalizedNerve,+ simplicesAtDimension,+ )+import Test.Tasty (TestTree, testGroup)+import Test.Tasty.HUnit (Assertion, assertFailure, testCase, (@?=))++tests :: TestTree+tests =+ testGroup+ "main and simplicial facades"+ [ testCase+ "site imports compile, normalize, and recover names without Pure imports"+ testFacadeOnlySiteNerve+ ]++testFacadeOnlySiteNerve :: Assertion+testFacadeOnlySiteNerve =+ case thinSiteImportKernel threeModuleManifest of+ Left siteError ->+ assertFailure ("import kernel rejected a valid module manifest: " <> show siteError)+ Right kernel -> do+ let normalized = normalizedNerve (thinSiteKernelCodomain kernel) 2+ fVector = length . simplicesAtDimension normalized <$> [0, 1, 2]+ fVector @?= [3, 3, 1]+ case simplicesAtDimension normalized 2 of+ [topSimplex] ->+ traverse+ (thinSiteObjectValue kernel)+ (chainVertices (nerveSimplexChain topSimplex))+ @?= Right ("app" :| ["api", "core"])+ topSimplices ->+ assertFailure+ ( "expected exactly one normalized 2-simplex, found "+ <> show (length topSimplices)+ )++threeModuleManifest :: SiteManifest String+threeModuleManifest =+ SiteManifest+ { siteObjects = Set.fromList ["app", "api", "core"],+ siteImports =+ Map.fromList+ [ ("app", Set.singleton "api"),+ ("api", Set.singleton "core"),+ ("core", Set.empty)+ ],+ siteCovers =+ Map.fromList+ [ ("app", Set.fromList ["api", "core"]),+ ("api", Set.singleton "core"),+ ("core", Set.empty)+ ]+ }
test/facade/FacadeTests.hs view
@@ -4,10 +4,13 @@ where import qualified NotationSpec+import qualified FacadeSiteNerveSpec import Test.Tasty (TestTree, testGroup) tests :: TestTree tests = testGroup "facade"- [NotationSpec.tests]+ [ NotationSpec.tests,+ FacadeSiteNerveSpec.tests+ ]
test/simplicial/NerveSpec.hs view
@@ -33,12 +33,13 @@ generatedSimplicesAtDimension, mkHorn, mkInnerHorn,- nerve,- nerveGenerated, nerveSimplexChain, nerveSimplexDimension, nerveSimplexFromChain,+ normalizeGeneratedSSet,+ normalizedNerve, simplicesAtDimension,+ unnormalizedNerve, ) import Laws.Suite (LawSuiteConfig (..), mkLawfulCarrierSpec) import Moonlight.Pale.Test.Laws.Suite (LawSuite)@@ -154,7 +155,7 @@ innerHornFillMatchesSimplex :: GeneratedFiniteCategory -> Bool innerHornFillMatchesSimplex generatedValue =- let simplicialSet = nerve (generatedCategory generatedValue) (generatedTruncation generatedValue)+ let simplicialSet = normalizedNerve (generatedCategory generatedValue) (generatedTruncation generatedValue) in and [ case mkHorn nerveSimplexDimension (applyFaceAtDimension simplicialSet) simplexDimension missingFace faceEntries of Left _ -> False@@ -180,11 +181,11 @@ lawfulCarrierSpec :: LawSuite lawfulCarrierSpec = mkLawfulCarrierSpec- "nerve"+ "normalized nerve" LawSuiteConfig- { lawSuiteName = "nerve simplicial laws",+ { lawSuiteName = "normalized nerve simplicial laws", lawSuiteMaxSuccess = 300,- lawSuiteCarrierToSSet = \generatedValue -> nerve (generatedCategory generatedValue) (generatedTruncation generatedValue),+ lawSuiteCarrierToSSet = \generatedValue -> normalizedNerve (generatedCategory generatedValue) (generatedTruncation generatedValue), lawSuiteEquality = sameSimplex, lawSuiteRenderSimplex = show . simplexFingerprint }@@ -193,20 +194,31 @@ carrierTests = testGroup "Nerve"- [ testCase "generated and normalized carriers separate degenerate simplices" $ do- let generatedSet = nerveGenerated sampleFinCat 1- simplicialSet = nerve sampleFinCat 1- assertEqual "generated 0-simplices" 3 (length (generatedSimplicesAtDimension generatedSet 0))- assertEqual "generated 1-simplices" 6 (length (generatedSimplicesAtDimension generatedSet 1))+ [ testCase "unnormalized and normalized carriers separate degenerate simplices" $ do+ let generatedSet = unnormalizedNerve sampleFinCat 1+ simplicialSet = normalizedNerve sampleFinCat 1+ assertEqual "unnormalized 0-simplices" 3 (length (generatedSimplicesAtDimension generatedSet 0))+ assertEqual "unnormalized 1-simplices" 6 (length (generatedSimplicesAtDimension generatedSet 1)) assertEqual "normalized 0-simplices" 3 (length (simplicesAtDimension simplicialSet 0)) assertEqual "normalized 1-simplices" 3 (length (simplicesAtDimension simplicialSet 1)),+ testCase "normalizing the unnormalized nerve agrees with the normalized nerve" $ do+ let normalizedSet = normalizedNerve sampleFinCat 2+ normalizedFromUnnormalized = normalizeGeneratedSSet (unnormalizedNerve sampleFinCat 2)+ fingerprintRows simplicialSet =+ fmap+ (Set.fromList . fmap simplexFingerprint . simplicesAtDimension simplicialSet)+ [0 .. 2]+ assertEqual+ "normalized simplex rows"+ (fingerprintRows normalizedSet)+ (fingerprintRows normalizedFromUnnormalized), testCase "inner horn filler reconstructs a composable 2-simplex" $ do let oneChains = chainsOfDimension sampleFinCat 1 maybeFirst = lookupSingleMorphismChain (generatorMorphismId 10) oneChains maybeSecond = lookupSingleMorphismChain (generatorMorphismId 11) oneChains case (maybeFirst, maybeSecond) of (Just firstChain, Just secondChain) ->- let simplicialSet = nerve sampleFinCat 2+ let simplicialSet = normalizedNerve sampleFinCat 2 hornEntries = [(2, nerveSimplexFromChain firstChain), (0, nerveSimplexFromChain secondChain)] in case mkHorn nerveSimplexDimension (applyFaceAtDimension simplicialSet) 2 1 hornEntries of Left _ -> assertBool "expected a compatible inner horn" False@@ -220,6 +232,6 @@ assertEqual "filled simplex dimension" 2 (nerveSimplexDimension simplexValue) assertEqual "filled simplex chain length" 2 (length (chainMorphisms (nerveSimplexChain simplexValue))) _ -> assertBool "expected generator chains in dimension 1" False,- QC.testProperty "inner horns reconstruct original simplex in generated nerves" $+ QC.testProperty "inner horns reconstruct original simplex in normalized nerves" $ QC.withNumTests 200 innerHornFillMatchesSimplex ]
test/site/SiteSpec.hs view
@@ -9,7 +9,15 @@ import qualified Data.Map.Strict as Map import Data.Set (Set) import qualified Data.Set as Set-import Moonlight.Category.Pure.Site.Compile (thinSiteKernel)+import Moonlight.Category (allObjects)+import Moonlight.Category.Pure.Site.Compile+ ( ThinSiteObjectValueError (..),+ thinSiteFinObject,+ thinSiteImportKernel,+ thinSiteKernel,+ thinSiteKernelCodomain,+ thinSiteObjectValue,+ ) import Moonlight.Category.Pure.Site.Core (SiteFinCatError (..), SiteManifest (..), SiteViolation (..)) import Moonlight.Category.Pure.Site.Graph (importCycles, reachableClosure) import Moonlight.Category.Pure.Site.Manifest (validateSiteManifest)@@ -39,6 +47,18 @@ "manifest validation and kernel compilation share diagnostics" testManifestValidationAndKernelDiagnosticsAgree, testCase+ "site kernel round-trips every semantic and codomain object"+ testThinSiteKernelObjectRoundTrips,+ testCase+ "site kernel rejects a finite object from a foreign codomain"+ testThinSiteKernelRejectsForeignCodomainObject,+ testCase+ "import kernel accepts import-valid cover-invalid manifests while the full kernel rejects them"+ testThinSiteImportKernelSeparatesCoverValidation,+ testCase+ "import and full kernels agree for a valid manifest"+ testThinSiteKernelsAgreeOnValidManifest,+ testCase "validateSiteManifest reports cover sets that are not closed under covered covers" testValidateSiteManifestReportsCoverClosureViolation ]@@ -111,6 +131,71 @@ NonEmpty.toList violations @?= validateSiteManifest invalidCoverManifest Right _ -> assertFailure "invalid cover produced a validated site kernel" +testThinSiteKernelObjectRoundTrips :: Assertion+testThinSiteKernelObjectRoundTrips =+ case thinSiteKernel roundTripManifest of+ Left siteError ->+ assertFailure ("round-trip manifest failed to compile: " <> show siteError)+ Right kernel -> do+ let manifestObjects = Set.toAscList (siteObjects roundTripManifest)+ codomainObjects = allObjects (thinSiteKernelCodomain kernel)+ case traverse (thinSiteFinObject kernel) manifestObjects of+ Left lookupError ->+ assertFailure ("semantic object failed to compile: " <> show lookupError)+ Right finObjects ->+ case traverse (thinSiteObjectValue kernel) finObjects of+ Left objectValueError ->+ assertFailure ("compiled object failed to recover: " <> show objectValueError)+ Right recoveredObjects ->+ recoveredObjects @?= manifestObjects+ case traverse (thinSiteObjectValue kernel) codomainObjects of+ Left lookupError ->+ assertFailure ("codomain object failed to recover: " <> show lookupError)+ Right recoveredObjects ->+ Set.fromList recoveredObjects @?= siteObjects roundTripManifest++testThinSiteKernelRejectsForeignCodomainObject :: Assertion+testThinSiteKernelRejectsForeignCodomainObject =+ case (thinSiteKernel roundTripManifest, thinSiteKernel foreignCodomainManifest) of+ (Right kernel, Right foreignKernel) ->+ case thinSiteFinObject foreignKernel 0 of+ Left lookupError ->+ assertFailure ("foreign kernel did not produce its declared object: " <> show lookupError)+ Right foreignObject ->+ case thinSiteObjectValue kernel foreignObject of+ Left (ThinSiteForeignCodomainObject _ _ _) -> pure ()+ otherResult ->+ assertFailure ("foreign codomain object was not rejected: " <> show otherResult)+ (leftResult, rightResult) ->+ assertFailure+ ( "foreign-codomain fixtures failed to compile: "+ <> show (leftResult, rightResult)+ )++testThinSiteImportKernelSeparatesCoverValidation :: Assertion+testThinSiteImportKernelSeparatesCoverValidation =+ case (thinSiteImportKernel invalidCoverManifest, thinSiteKernel invalidCoverManifest) of+ (Right _, Left (SiteManifestInvalid _)) -> pure ()+ outcomes ->+ assertFailure ("import and full kernels did not separate cover validation: " <> show outcomes)++testThinSiteKernelsAgreeOnValidManifest :: Assertion+testThinSiteKernelsAgreeOnValidManifest =+ case (thinSiteImportKernel roundTripManifest, thinSiteKernel roundTripManifest) of+ (Right importKernel, Right fullKernel) -> do+ thinSiteKernelCodomain importKernel @?= thinSiteKernelCodomain fullKernel+ let manifestObjects = Set.toAscList (siteObjects roundTripManifest)+ case+ ( traverse (thinSiteFinObject importKernel) manifestObjects,+ traverse (thinSiteFinObject fullKernel) manifestObjects+ ) of+ (Right importObjects, Right fullObjects) ->+ importObjects @?= fullObjects+ outcomes ->+ assertFailure ("valid kernels disagreed about a manifest object: " <> show outcomes)+ outcomes ->+ assertFailure ("valid manifest failed to compile under one kernel scope: " <> show outcomes)+ declaredCycleManifest :: SiteManifest String declaredCycleManifest = let objects = set ["domain", "service"]@@ -130,6 +215,42 @@ { siteObjects = Set.singleton 0, siteImports = Map.singleton 0 Set.empty, siteCovers = Map.singleton 0 (Set.singleton 1)+ }++roundTripManifest :: SiteManifest Int+roundTripManifest =+ SiteManifest+ { siteObjects = set [0, 1, 2],+ siteImports =+ Map.fromList+ [ (0, set [1]),+ (1, set [2]),+ (2, Set.empty)+ ],+ siteCovers =+ Map.fromList+ [ (0, set [1, 2]),+ (1, set [2]),+ (2, Set.empty)+ ]+ }++foreignCodomainManifest :: SiteManifest Int+foreignCodomainManifest =+ SiteManifest+ { siteObjects = set [0, 1, 2],+ siteImports =+ Map.fromList+ [ (0, set [1]),+ (1, Set.empty),+ (2, Set.empty)+ ],+ siteCovers =+ Map.fromList+ [ (0, set [1]),+ (1, Set.empty),+ (2, Set.empty)+ ] } testValidateSiteManifestReportsCoverClosureViolation :: Assertion