You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upon reflection of our current architecture I suggest we follow course 2., and in essence 1. is just 2. in disguise.
With 1.<substmorph> is already an abstract class, meaning it is in essence already an interface.
We can setup this architecture as follows:
cat-morph
cat-obj
Are the new interfaces. They may pledge a core set of functions like:
(dom ...)
(codom ...)
(curry ...)
etc. etc. etc.
Along with #63 we can enforce this through our interface idea. We can use stealth-mixins to implement this fact after class creation
Now, if we want to extend our core category, then we just implement the cat-morph and cat-obj interfaces.
Further the extensions that <substmorph> implements many may not be available in every extension set, and thus we can implement those as part of a new interface set of extensions.
For type checking purposes, if one makes an ADT with slots of a certain type, instead of making them on your concrete subclass, instead make them on the open type cat-morph and cat-obj instead. Our code was previously already doing this with <substmoprh and <substobj>
One conceit of this style of code is that any recursive function must be apart of an interface, but that is fine, we already do that.
(defmethodso-card-alg ((obj <substobj>))
;; we don't use the cata morphism so here we are. Doesn't give me;; much extra
(match-of geb:substobj obj
(geb:alias (so-card-alg (obj obj)))
((geb:prod a b) (* (so-card-alg a)
(so-card-alg b)))
((geb:coprod a b) (+ (so-card-alg a)
(so-card-alg b)))
(geb:so0 1)
(geb:so1 1)))
Perhaps we can make some general recursive functions, so we don't have to tediously do this for every core functionality, meaning we should be able to derive most of these functions from the core interface. I think @rokopt would have some good ideas on recurses for the data type in particular.
The text was updated successfully, but these errors were encountered:
The central question of open extension should rest on:
Should we
<substmorph>
Upon reflection of our current architecture I suggest we follow course
2.
, and in essence1.
is just2.
in disguise.With
1.
<substmorph>
is already an abstract class, meaning it is in essence already an interface.We can setup this architecture as follows:
cat-morph
cat-obj
Are the new interfaces. They may pledge a core set of functions like:
Along with #63 we can enforce this through our interface idea. We can use stealth-mixins to implement this fact after class creation
Now, if we want to extend our core category, then we just implement the
cat-morph
andcat-obj
interfaces.Further the extensions that
<substmorph>
implements many may not be available in every extension set, and thus we can implement those as part of a new interface set of extensions.For type checking purposes, if one makes an ADT with slots of a certain type, instead of making them on your concrete subclass, instead make them on the open type
cat-morph
andcat-obj
instead. Our code was previously already doing this with<substmoprh
and<substobj>
Thus we should change
into
One conceit of this style of code is that any recursive function must be apart of an interface, but that is fine, we already do that.
Perhaps we can make some general recursive functions, so we don't have to tediously do this for every core functionality, meaning we should be able to derive most of these functions from the core interface. I think @rokopt would have some good ideas on recurses for the data type in particular.
The text was updated successfully, but these errors were encountered: