From h@wickh@m @ending from gm@il@com  Thu Aug  9 16:36:32 2018
From: h@wickh@m @ending from gm@il@com (Hadley Wickham)
Date: Thu, 9 Aug 2018 09:36:32 -0500
Subject: [Rd] vctrs: a type system for the tidyverse
In-Reply-To: <CABdHhvH53=0b7Hg=9dAPx9zUTn4YSYR0=JoDzWMRMjkMpmXbBQ@mail.gmail.com>
References: <CABdHhvFARmiExcEk=NUjfPcRtYnoF4pAA5WTws6r1C+X76zHEw@mail.gmail.com>
 <CAMFmJsn_wNxuV2SQqUiZroJYV+rHRKdADi8Fjg8fRjJr0RGuwQ@mail.gmail.com>
 <CABdHhvEAV-bhprxVMHF_R8vKdN3VEriV86kGNNU02RiK=+m4dQ@mail.gmail.com>
 <CABdHhvHw+_sFcD3H92KQhvurxC8eAyR2A0frZUk7pBcOaVB2Hw@mail.gmail.com>
 <23403.4648.841262.201573@stat.math.ethz.ch>
 <CABdHhvH53=0b7Hg=9dAPx9zUTn4YSYR0=JoDzWMRMjkMpmXbBQ@mail.gmail.com>
Message-ID: <CABdHhvGucJKbaFmB1gk3i0vgen9OPQ7Wb=nQKm7aOoBFbC0sqA@mail.gmail.com>

> > As Gabe mentioned (and you've explained about) the term "type"
> > is really confusing here.  As you know, the R internals are all
> > about SEXPs, TYPEOF(), etc, and that's what the R level
> > typeof(.) also returns.  As you want to use something slightly
> > different, it should be different naming, ideally something not
> > existing yet in the R / S world, maybe 'kind' ?
>
> Agreed - I've been using type in the sense of "type system"
> (particularly as it related to algebraic data types), but that's not
> obvious from the current presentation, and as you note, is confusing
> with existing notions of type in R. I like your suggestion of kind,
> but I think it might be possible to just talk about classes, and
> instead emphasise that while the components of the system are classes
> (and indeed it's implemented using S3), the coercion/casting
> relationship do not strictly follow the subclass/superclass
> relationships.

I've taken another pass through (the first part of) the readme
(https://github.com/r-lib/vctrs#vctrs), and I'm now confident that I
can avoid using "type" by itself, and instead always use it in a
compound phrase (like type system) to avoid confusion. That leaves the
`.type` argument to many vctrs functions. I'm considering change it to
.prototype, because what you actually give it is a zero-length vector
of the class you want, i.e. a prototype of the desired output. What do
you think of prototype as a name?

Do you have any thoughts on good names for distinction vectors without
a class (i.e. logical, integer, double, ...) from vectors with a class
(e.g. factors, dates, etc). I've been thinking bare vector and S3
vector (leaving room to later think about S4 vectors). Do those sound
reasonable to you?

Hadley

-- 
http://hadley.nz



[Rd] vctrs: a type system for the tidyverse
Hadley Wickham