Skip to content

benhutchison/learningshapeless

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learning Shapeless: Workshop Exercises

This repo contains a collections of exercises designed to help you learn the Shapeless library and Type-level programming.

Introductory slides.

Workshop setup

Assumes you have Java 8 and sbt pre-installed.

git clone https://github.com/benhutchison/learningshapeless.git
git clone https://github.com/benhutchison/learningshapeless.git -b solutions solutions-learning-shapeless
cd learning-shapeless
sbt   #leave sbt running between commands
> update
> run
#optionally to dig deeper into shapeless:
git clone https://github.com/milessabin/shapeless.git

Exercise and Solution Branches

On the master branch, there are a mix of annotated code examples (generally names eg_<something>) and exercises. Study the examples before trying the exercises, they demonstrate features of Shapeless and relevant techniques. Code exercises are often named ex_<something>, but some exercises are described within inline docs, and may involve annotating types, uncommenting code, or writing explanations.

The solutions branch contains solutions and/or explanations for all exercises. You can use this either to check your work after having attempted an exercise, or as a learning aid, if you're not able to progress.

Experiment!

All exercises are runnable using SBTs run task. printlns are sprinkled in so you can view expressions. Alternately you can use SBTs console task to start a REPL with the projects' classes available for import & use.

Be aware that for many exercises, getting them to compile can be a hard as getting them to run.

Suggested Order of Exercises

Foundations

Techniques for Generic Programming

Advanced

Other

Known Issues

@ssanj pointed out that Shapeless illTyped() macro doesn't always work correctly in the REPL, ie anything you define inside of the REPL is not seen by illTyped (stack overflow)

About

Materials for workshop on Type-level programming with Shapeless

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published