From vitekj @ending from icloud@com  Fri Aug 10 01:54:24 2018
From: vitekj @ending from icloud@com (jan Vitek)
Date: Fri, 10 Aug 2018 00:54:24 +0100
Subject: [Rd] vctrs: a type system for the tidyverse
In-Reply-To: <CABdHhvHNqWFDamNQU1ZC_Z022LdE0qBzz4swYGkMV1eFi-2hHA@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>
 <A260BC05-0755-4911-98B3-74071569A9F4@icloud.com>
 <CABdHhvHNqWFDamNQU1ZC_Z022LdE0qBzz4swYGkMV1eFi-2hHA@mail.gmail.com>
Message-ID: <DEF40A8A-7A92-4E7F-9456-9185B6992CFD@icloud.com>


> 
> I think there's a bit of that flavour here:
> 
> vec_c(factor("a"), Sys.Date())
> #> Error: No common type for factor and date
> 
> This isn't a type system imposed by the language, but I don't think
> that's a reason not to call it a type system.

All I am saying is that without a clear definition of what is the class 
of errors being prevented CS folks would not think of it as a type system. 

In Java, the type system guarantees that you will not have a Method Not 
Understood Error.  In ML, the type system ensure that all operations are 
applied to the data types that they are defined for.

Also, a type system gives a guarantee over all programs. Here the guarantee
only applies for certain functions.


This said it would be interesting to describe precisely what are things
that are errors that ought to be prevent for R.  

The discussion on what happens when you merge two vectors with different 
factor levels is really interesting in that respect as it suggest that
there are non-trivial issues that need to be worked out.


-j



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