Skip to content

Commit

Permalink
diag-ops [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ComFreek committed Apr 13, 2024
1 parent d4e1202 commit 7026337
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,14 @@ object DiagramConnection {

object Singleton {
def apply(domTheory: MPath, codTheory: MPath, mor: Term): DiagramConnection = {
DiagramConnection(
new DiagramConnection(
DiagramFunctor(Diagram(List(domTheory)), Diagram(List(codTheory)), Map(domTheory -> OMMOD(codTheory))),
Map(domTheory -> mor)
)
Map(domTheory -> mor)) {
override def applyTheory(thy: MPath): Term = thy match {
case `domTheory` => mor
case _ => OMCOMP(OMIDENT(OMMOD(thy)), mor) // i.e., mor domain-restricted to thy
}
}
}

def unapply(connection: DiagramConnection): Option[(MPath, MPath, Term)] = connection match {
Expand Down
Loading

0 comments on commit 7026337

Please sign in to comment.