Shapeless Meets Implicit Macros
Why Stack Overflow recommends it
Stack Overflow users link it when answering questions about learning shapeless or about type-level limits such as the Nat encoding, since it comes straight from the library's author.
Recommended by 1 people across 1 different months, 2013 to 2014.
What it is
A 38-minute conference talk from NE Scala 2013 in which Miles Sabin, creator of the shapeless library, shows how Scala implicit macros can improve shapeless, which guides behavior through implicit resolution. It covers common failure modes of implicit-heavy code and how macros help.
What people said
Recommends 4lex1v · 2013-06 · Stack Overflow · on “how do i start learning shapeless concepts in scala”
I don't know if thats an answer you wan't, but the best push for me to start learning/using shapeless was a couple of Miles videos from different Scala conferences : From flatmap [LINK] ScalaNE 2012 [LINK] ScalaNE 2013 [this video] His forgotten blog [LINK] And as a big practise - i'm writing a lot using Spray toolkit [LINK] , it uses shapeless inside. So try to write some web server or some client. Also a github's wiki contains good intro for the library. Great idea - try to rewrite some case classes into shapeless records with hlists, it's pretty cool to use it with some JSON converter =). Much of it is some generic kind of stuff wich is not very useful in real project, but if you want better u
Cites George · 2013-04 · Stack Overflow · on “How to convert a Tuple of Tuples to a Map”
If you are willing to pull a dependency into your project, this kind of typelevel things are what shapeless [LINK] is good for: > shapeless-core/console [warn] Credentials file /home/folone/.ivy2/.credentials does not exist [info] Compiling 24 Scala sources to /home/folone/workspace/shapeless/core/target/scala-2.11/classes... [info] Starting scala interpreter... [info] Welcome to Scala version 2.11.0-20130205-141957-132e09fc2e (OpenJDK 64-Bit Server VM, Java 1.7.0_17). Type in expressions to have them evaluated. Type :help for more information. scala> import shapeless._ import shapeless._ scala> import Tuples._ import Tuples._ scala> val tuples = (("a", 3), ("b", 1), ("c", 7), ("z", 10)) tup
Cites Travis Brown · 2014-01 · Stack Overflow · on “Limits of Nat type in Shapeless”
Miles's NE Scala presentation [this video] last year addresses this question, and the short answer is that it would be possible to represent large numbers at the type level in Scala—or at least in 2.10—using singleton types [LINK] , but it might not be worth it [LINK] . Shapeless 2.0 currently still uses the Church encoding, which will get you to 1,000 or so before the compiler gives up.