shapeless-2.3.0 is out!
Lots of issues closed (61 to be precise) and PRs merged (85 in total) from the largest number of contributors to any shapeless release so far (a grand total of 26 … thanks to all of you!). This release to some extent represents consolidation in the light of the experience of the many projects downstream of shapeless. But there have been other significant changes.
One of the biggest is that the project branch and build structure has been completely reworked. shapeless is now built for all permutations of Scala 2.10/11/12 and JVM and Scala.js from a single branch using macro-compat and the new support for JUnit in Scala.js 0.6.6+.
On the face of it, this runs counter to what I said in the release notes for 2.2.0,
My “one branch per platform” policy seems to be paying off: managing the differences between Scala 2.11.x and Scala 2.10.x for each of the JVM and Scala.js by branching and merging (as opposed to managing platform variations within a single branch) is working out very smoothly.
but I’m not backing away from that entirely.
It’s certainly true that managing releases from four branches became somewhat unweildy, but that was mitigated to a very large extent by the multi-branch relase script contributed by Johnny Everson. What really changed is that the state of the art for dealing with cross-platform builds for both Scala.JVM and Scala.JS has moved on significantly … I’d particularly like to thank Alistair Johnson for all the work he’s done on this across the entire gamut of Typelevel projects.
When I started work on export-hook I wanted to take advantage of that and, as an experiment, decided to try going for a single branch approach to dealing with macros on Scala 2.10.x vs. 2.11.x as well … this led to the development of macro-compat which I think has worked out beautifully. Having seen the benefits of this approach in export-hook it seemed that it would be worth seeing if it would scale to the more extensive macro usage in shapeless as well. To cut a long story short, it did … and I’d like to thank Dale Wijnand for his amazing contribution to that.
So where does that leave what I said in 2.2.0 release notes? In the absence of macro-compat, or something equivalent, if you have non-trivial macros, I still think it would be preferable to manage the difference between the 2.10.x and 2.11.x macro APIs by branching. But, for me at least, that’s now moot.
For the rest of the changes in 2.3.0, see the detailed release notes below …
Many thanks to everyone who contributed!
This is the final release of shapeless-2.3.0. These release notes provide a summary of changes since shapeless 2.2.5.
The project branch and build structure has been completely reworked. shapeless is now built for all permutations of Scala 2.10/11/12 and JVM and Scala.js from a single branch using macro-compat and the new support for JUnit in Scala.js 0.6.6+.
There are a large number of new features, refactorings and bug fixes in shapeless 2.3.0. The most significant of these are,
- Many bug fixes and improvements in the implementation of
- Many bug fixes and improvements in the implementations of
Split1in support of Kittens.
- Added Annotation and Annotations type classes providing evidence of the presence of annotations on a type, or on the elements or constructors of an ADT.
AsOptionstype classes providing evidence of the default values for the constructors of product types as
LabelledGeneric[T]no longer extends
- Dramatically improved compile time performance for record select and update.
ZipWithIndextype class for
ToSumtype classes for
ToCoproductTraversabletype class allowing conversion of an
HListto a homogenous collection of the
Coproductof its element types.
SelectRangetype classes allowing elements of an
HListto be selected given a set or range of
PaddedGroupertype classes allowing
HListsand tuples to be subdivided into smaller tuples of a given size.
Difftype classes supporting set-like operations on
ModifierAttype class supporting functional update of elements of
HListsand tuples at a given
CollectFirsttype class which applies a
Polyto the first compatible element of an
LiftAlltype class which collects instances of a type class for each element of an
Slicetype classes which support padding and slicing
FromMaptype class which supports type safe conversion of a homogenous
Mapto a record.
RemoveAlltype classes supporting removing of one or more fields from a record. These operations are reversible via
ToSizedHListtype class which support conversion of a homogenous collection to an
HListof a known size.
- Improved readability of
cachedImplicitnow uses a more reliable mechanism for preventing self-loops.
Cachedtype constructors which modify the semantics of
Lazyby eliminating unnecessary closures and by sharing instances respectively.
LowPrioritymechanism for controlling the priority of instances during implicit resolution.
- User supplied
@implicitNotFoundannotations are now propagated through
NatProductArgswhich allows argument lists of
Intliterals to be mapped to
GTEqtype classes for
NatWithwhich supports conversion of
Natvalues and simultaneously summoning a specified type class at the corresponding
Widentype class which allows the widening of a singleton type and value to the corresponding non-singleton type.
runtimeListmethod allowing conversion of an
List[Any]efficiently when precise types are not needed.
Unwrappedtype class which allow access to the value underlying a newtype or value class.
- The experimental support for lifting polymorphic methods to
Polyvalues has been removed.
Source and binary compatibility
shapless 2.3.0 is source compatible with 2.2.5. As indicated by the version number bump, however, shapeless 2.3.0 is not binary compatible with shapeless 2.2.x.
Contributors for shapeless 2.3.0 are,
- Alessandro Lacava @lambdista
- Alexandre Archambault @alxarchambault
- Andreas Koestler @AndreasKostler
- Chris Hodapp @clhodapp
- Cody Allen @fourierstrick
- Dale Wijnand @dwijnand
- Dave Gurnell @davegurnell
- Frank S. Thomas @fst9000
- Hamish Dickenson @hamishdickson
- Matthew Taylor
- Michael Donaghy
- Michael Pilquist @mpilquist
- Miles Sabin @milessabin
- Neville Li @sinisa_lyh
- Olivier Blanvillain
- Olli Helenius @ollijh
- Owein Reese @OweinReese
- Pavel Chlupacek @pacmanius
- Rob Norris @tpolecat
- Robert Hensing
- Ryo Hongo @ryoppy516
- Tin Pavlinic @triggerNZ
- Tomas Mikula @tomas_mikula
- Travis Brown @travisbrown
- Valentin Kasas @ValentinKasas
- Vladimir Pavkin @vlpavkin
Many thanks to all of you and everyone else who has contributed ideas, enthusiasm and encouragement.