AlgebraicJulia / Catlab.jl

A framework for applied category theory in the Julia language
https://www.algebraicjulia.org
MIT License
608 stars 58 forks source link

Refactor FinSets from FinSetImpls, etc #889

Open KevinDCarlson opened 7 months ago

KevinDCarlson commented 7 months ago

"It's something unpredictable//But in the end it's right..." --Billie Joe Armstrong

It's too hard to have FinDomFunction and FinSet be abstract types. Make them and others concrete types according to the general design

abstract type FinSetImpl
struct FinSet
  theSet::FinSetImpl
end

Then we refactor so that the majority of functions involving sets and functions act on the pseudo-concrete wrapper types, which means you can't access details of the implementation, but on the other hand you can map over something without constantly freaking out over whether it's a collection of FinDomFunctionDicts or FinDomFunctionVectors.