Oh, maybe I was not precise enough. Just changing the version number does not change the functionality, it is an indicator for users that there was a breaking change, so that they have to adapt their code.
You would still have to decide to move the definition of the PeriodicSymbolicMatrix
to exacty one package, otherwise you always have two such types.
Again, I can not see your dev version, so I can just guess:
You currently seem to define the type in both packages still. This still creates two completely different types. It looks like, currently only one of them, PeriodicMatrices
exports the type and hence only one is available in global scope.
I conclude that from the fact that you can define A
(and that ps1
fails).
The PeriodicSystems
tape is not exported, because that would cause an ambiguity and you would have to specify which of the two types A
should be of.
But then of course ps1
is defined for the (non-exported, internal) data type of a PeriodicSymbolicMatrix
within the PeriodicSystems
which due to the two completely different types is not the type of A
. so sure the ps1
call fails, unless you specifically use that type for which ps1
is defined.
A good analogy is really again two people, maybe even born on the same day of same name.
One lives in PeriodicSystems
, one lives in PeriodicMatrices
and that name is also exported (make known to) Main
if you are using
the package.
They are still two completely different types (people) that just share the same name.
I see really only one solution here. Do not define the type twice. It now confuses you as the developer so it will confuse most of your users.
I would do the following β also since you are βextractingβ the matrices into their own package.
- Define the type only in
PeriodicMatrices
and export it there
- Make
PeriodicMatrices
a dependency of PeriodicSystems
and use the type that PeriodicMatrices
defines therein as well
This can even be done in a non.breaking way, since someone only using PeriodicSystems
would not even notice a difference.
Your last type of code confuses me though, because it seems you might have even done this already? Again, all of this post is merely written on guessing what your current code status is. It would maybe be easier to actually do a small zoom meeting instead of this now really really long thread where we try to reverse-engineer from your errors both what you current package status and REPL status is.
The main message and thing to follow is: Do not define the type twice. Define it once and only use it in the other package then (that of course then depends on the one where you define it).