Tech Listicles by Makers.
December 26, 2018
What is shapeless? Well its a library for doing generic programming in Scala. What is generic programming, well that is a little harder to explain. Generic programming is the type of polymorphism your lanugage doesn’t support. That is how it was described by Simon Peyton.
To me, that description seems like circular reasoning, but hopefully it will all make sense by the time you get to the end of this list.
This free ebook from underscore walks through shapeless in some fun detail. I recommend after reading it you attempt to build your CSV parser and after that try your own Json parser using the techniques learned in the book.
If you have questions after reading the shapeless book then gitter is a great place to go. There is an IRC channel and a mailing list as well, but gitter seems to be where the action is.
Scala Exercises has a whole section of shapeless exercises that you can use to cement your knowledge of the shapeless library.
In this interview with Miles Sabbin, the creator of shapeless, he explains how he created shapeless and also the reason why he created it. The why is actually a pretty interesting story. This was one of the first interviews I did for my podcast, and talking with Miles helped me understand some of the big picture ideas behind type level programming.
An article tackling whether using shapeless is worth it. Spoiler alert, it is if you like type safey and avoid boiler plate.
@skaalf’s guide to getting started with shapeless.
Here is Miles on twitter. Follow him to keep up to date not just on shapeless but on many exicting type level projects.
This talk by Miles is about Kind Polymorphism. It is not totally related to Shapeless itself, but very interesting. If you listen to the inteview in #4, you will hear me fail to understand what kind polymorphism is. After this talk, it is making more sense.
Here is a video version of the first link. I think the book is actaully based on the talk. The video gives a great overview of the high level reasons for wanting to abstract over arity and use generic representations to reduce boilerplate.
Last, but not least, is the source for shapeless. Shapeless is an opensource project with many contributors, so jump in and see if you can contribute.
There we go. So shapeless is geneic programming and generic programming is the type of polymorphism your lanuage doesn’t support. I hope I’ve given you some resources to learn about shapeless and generic programming.
Written by Adam Gordon Bell.