From vitekj @ending from icloud@com  Thu Aug  9 23:25:01 2018
From: vitekj @ending from icloud@com (jan Vitek)
Date: Thu, 09 Aug 2018 22:25:01 +0100
Subject: [Rd] vctrs: a type system for the tidyverse
In-Reply-To: <CABdHhvGucJKbaFmB1gk3i0vgen9OPQ7Wb=nQKm7aOoBFbC0sqA@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>
 <CABdHhvGucJKbaFmB1gk3i0vgen9OPQ7Wb=nQKm7aOoBFbC0sqA@mail.gmail.com>
Message-ID: <A260BC05-0755-4911-98B3-74071569A9F4@icloud.com>

> 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?


The term ?type system? in computer science is used in very different ways.
What the note describes is not a type system, but rather a set of 
coercions used by a small number of functions in one package.

Typically it refers to a set of rules (either statically enforced
by the compiler or dynamically enforced by the runtime) that ensure
that some particular category of errors can be caught by the 
language.

There is none of that here.

My suggestion would be to avoid ?type system?.


"The short-term goal of vctrs is to develop a type system for vectors which will help reason about functions that combine different types of input (e.g. c(), ifelse(), rbind()). The vctrs type system encompasses base vectors (e.g. logical, numeric, character, list), S3 vectors (e.g. factor, ordered, Date, POSIXct), and data frames; and can be extended to deal with S3 vectors defined in other packages, as described in vignette("extending-vctrs?).?

==>

The short-term goal of vctrs is to specify the behavior of functions that combine different types of vectors (e.g. c(), ifelse(), rbind()). The specification encompasses base vectors (e.g. logical, numeric, character, list), S3 vectors (e.g. factor, ordered, Date, POSIXct), and data frames; and can be extended to deal with S3 vectors defined in other packages, as described in vignette("extending-vctrs?).

and so on.

-j


[Rd] vctrs: a type system for the tidyverse
jan Vitek