CanonicalTraits.jl icon indicating copy to clipboard operation
CanonicalTraits.jl copied to clipboard

maybe rename `@trait` `@ctrait`

Open JeffreySarnoff opened this issue 6 years ago • 14 comments

trait is used in the "non-canonical trait" sense in many places throughout Julia code and docs. For that reason only, using a macro name that differs from "@trait" may be helpful to the wider use and easier general understanding of this package, when released. I thought @ctrait (for canonical trait) might work well.

JeffreySarnoff avatar Sep 08 '19 00:09 JeffreySarnoff

You're mostly right because holy trait has been widespread. However the term "ctrait" sounds a bit weird. In fact, I womder if "class" or "interface" is accept for you. @class can refer to typeclass, and "interface" is a term used to represent the same thing in some recent PL contexts(e.g., Idris community)

thautwarm avatar Sep 08 '19 02:09 thautwarm

How about @typeclass, as @class will be misunderstood by many people.

JeffreySarnoff avatar Sep 08 '19 03:09 JeffreySarnoff

Okay. I'd like to ask some one to perform this change. There're many references of @trait in GG.jl and HigherKindedPolymorphisms.jl.

thautwarm avatar Sep 08 '19 04:09 thautwarm

only those two packages, and this one? (that use @trait)

JeffreySarnoff avatar Sep 08 '19 04:09 JeffreySarnoff

Yes, and I'm now updating GG.jl. Would you like to contribute to this collection of packages?

thautwarm avatar Sep 08 '19 04:09 thautwarm

sure -- I was going to do a multifile search and replace on each of them and submit those as PRs

JeffreySarnoff avatar Sep 08 '19 04:09 JeffreySarnoff

Great. Besides, in GG.jl, the only reference is at https://github.com/thautwarm/GG.jl/blob/parametric-type-encoding/src/typeable.jl#L28 .

thautwarm avatar Sep 08 '19 07:09 thautwarm

Oh, there're not too many occurrences of @trait outside this repo, in fact only twice.

thautwarm avatar Sep 08 '19 07:09 thautwarm

I have sent PRs with this change for CanonicalTraits.jl and HigherKindedPolymorphisms.jl. You should change @trait to @typeclass in GG.jl (I don't know how to PR to a named branch).

JeffreySarnoff avatar Sep 08 '19 08:09 JeffreySarnoff

(I don't know how to PR to a named branch

When making PR, there is an option to select the base branch. For pr to GG.jl, in default it's thautwarm/master, changing it is okay.

thautwarm avatar Sep 08 '19 08:09 thautwarm

CanonicalTraits.jl just got registered... lol, so there will be a breakage in the next releases. And you should bump up its version..

thautwarm avatar Sep 08 '19 08:09 thautwarm

I don't want to introduce breakage after the release -- maybe forget about the name change.

JeffreySarnoff avatar Sep 08 '19 08:09 JeffreySarnoff

In fact now no one except me is usinh this, could we ask helps from the community and the managers of JuliaRegistries?

thautwarm avatar Sep 08 '19 09:09 thautwarm

if that is the case, I will redo the PRs with your suggestions

JeffreySarnoff avatar Sep 08 '19 10:09 JeffreySarnoff