Type
, but it is useful to be
with { vertex: (%, Integer) -> Complex ; new: List Complex -> % }
Polygon with { vertex: (%, Integer) -> Complex ; new: List Complex -> % } == add { Rep == List Complex; new(l: List Complex): % == per l; vertex(p: %, i: Integer): Complex == rep(p).i; }
define Monoid: Category == with { 1: %; *: (%, %) -> % } define Finite: Category == with { cardinality: Integer }
Join
operator combines catgories, providing multiple inheritance:
define FiniteMonoid: Category == Join(Monoid, Finite)
define Module(R: Ring): Category == Ring with { *: (R, %) -> % } define ComplexCategory(R: Ring): Category == Module(R) with { complex: (R, R) -> R; real: % -> R; imag: % -> R; }