shapeless: generic programming for Scala
shapeless is a type class and dependent type based generic programming library for Scala. It had its origins in several talks by Miles Sabin (@milessabin), given over the course of 2011, on implementing scrap your boilerplate and higher rank polymorphism in Scala. Since then it has evolved from being a resolutely experimental project into library which, while still testing the limits of what's possible in Scala, is being used widely in production systems wherever there are arities to be abstracted over and boilerplate to be scrapped.
- Finding out more about the project
- Using shapeless
- Migration guides
- Building shapeless
Finding out more about the project
A full feature overview of shapeless-2.2.0 is in preparation. In the meantime, please refer to the release notes and the feature overview for shapeless-2.0.0 which can be found here. If you are upgrading from shapeless-2.0.0 you will find the migration guide useful.
shapeless is part of the Typelevel family of projects. It is an Open Source project under the Apache License v2, hosted on github. Binary artefacts are published to the Sonatype OSS Repository Hosting service and synced to Maven Central.
Most discussion of shapeless and generic programming in Scala happens on the shapeless Gitter channel. There is also a mailing list and IRC channel, but these are largely dormant now that most activity has moved to Gitter. Questions about shapeless are often asked and answered under the shapeless tag on StackOverflow. Some articles on the implementation techniques can be found on Miles's blog, and Olivera, Moors and Odersky, Type Classes as Object and Implicits is useful background material.
There is a wide variety of projects which use shapeless in one way or another ... see the incomplete list of projects for ideas and inspiration.
Whilst shapeless is a somewhat "advanced" Scala library, it is a lot more approachable than many people think. Contributors are usually available to field questions, give advice and discuss ideas on the Gitter channel, and for people wanting to take their first steps at contributing we have a selection of open issues flagged up as being good candidates to take on. No contribution is too small, and guidance is always available.
shapeless is built with SBT 0.13.7 or later. SBT 0.13.6 has an issue related to its new name hashing feature which when compiling shapeless causes SBT to loop indefinitely consuming all heap. Workarounds are to move to an earlier or later SBT version or disable name hashing by adding,
incOptions := incOptions.value.withNameHashing(false)
to your settings.
The master branch of shapeless is built with Scala 2.11.6 by default. To build with Scala 2.10.x you should check out the scala-2.10.x branch. As a general rule all new features and bugfixes are made against master and Scala 2.11.6 and merged into the scala-2.10.x branch with only the minimal changes needed for forwards compatibility.
- Alexander Konovalov email@example.com @alexknvl
- Alexandre Archambault firstname.lastname@example.org @alxarchambault
- Alistair Johnson email@example.com
- Alois Cochard firstname.lastname@example.org @aloiscochard
- Andrew Brett email@example.com @Ephemerix
- Ben Hutchison firstname.lastname@example.org @ben_hutchison
- Ben James email@example.com @bmjames
- Brian McKenna firstname.lastname@example.org @puffnfresh
- Chris Hodapp email@example.com @clhodapp
- Cody Allen firstname.lastname@example.org @fourierstrick
- Dale Wijnand email@example.com @dwijnand
- Dario Rexin firstname.lastname@example.org @evonox
- David Barri email@example.com @japgolly
- Denis Mikhaylov firstname.lastname@example.org @notxcain
- Eugene Burmako email@example.com @xeno_by
- Filipe Nepomuceno firstname.lastname@example.org
- George Leontiev email@example.com @folone
- Howard Branch firstname.lastname@example.org @purestgreen
- Huw Giddens email@example.com
- Jason Zaugg firstname.lastname@example.org @retronym
- Jean-Remi Desjardins email@example.com @jrdesjardins
- Johannes Rudolph firstname.lastname@example.org @virtualvoid
- Johnny Everson email@example.com @johnny_everson
- Joni Freeman firstname.lastname@example.org @jonifreeman
- Julien Tournay email@example.com @skaalf
- Jules Gosnell firstname.lastname@example.org
- Kevin Wright email@example.com @thecoda
- Lars Hupel firstname.lastname@example.org @larsr_h
- Mario Pastorelli email@example.com @mapastr
- Mathias Doenitz firstname.lastname@example.org @sirthias
- Michael Donaghy email@example.com
- Michael Pilquist firstname.lastname@example.org @mpilquist
- Miles Sabin email@example.com @milessabin
- Nikolas Evangelopoulos firstname.lastname@example.org
- Oleg Aleshko email@example.com @OlegYch
- Owein Reese firstname.lastname@example.org @OweinReese
- Paolo G. Giarrusso email@example.com @blaisorblade
- Pascal Voitot firstname.lastname@example.org @mandubian
- Renato Cavalcanti email@example.com @renatocaval
- Sam Halliday firstname.lastname@example.org @fommil
- Sarah Gerweck email@example.com @SGerweck
- Sébastien Doeraene firstname.lastname@example.org @sjrdoeraene
- Simon Hafner email@example.com @reactormonk
- Stacy Curl firstname.lastname@example.org @stacycurl
- Stephen Compall email@example.com @S11001001
- Tom Switzer firstname.lastname@example.org @tixxit
- Travis Brown email@example.com @travisbrown
- Vladimir Matveev firstname.lastname@example.org @netvlm