Keep in touch and up-to-date with the latest shapeless news here:
https://gitter.im/milessabin/shapeless
The shapeless codebase is on Miles' Github:
| import shapeless._ | |
| import slick.ast.TypedType | |
| import scala.reflect.ClassTag | |
| trait GenericColumnTypeImplicits { | |
| // This definition summons a column type for a type Pk provided: | |
| // - Pk is a case class with a single field of type Underlying; | |
| // - Slick can summon a column type for Underlying. | |
| // | |
| // It conflicts with MappedTo, |
| Introduction / Motivation | |
| Curriculum---what you teach | |
| - How to present Scala (OO, functional) | |
| - Design patterns | |
| Pedagogy---how you teach it | |
| Technology to support teaching | |
| Examples to motivate different students | |
| Who Can Support It / Develop It | |
| Why Invest in Learning Scala? |
| object TypeclasseDemo { | |
| // The parts of the type class pattern are: | |
| // | |
| // 1. the "type class" itself -- a trait with a single type parameter; | |
| // | |
| // 2. type class "instances" for each type we care about, | |
| // each marked with the `implicit` keyword; | |
| // | |
| // 3. an "interface" to the type class -- one or more methods |
| case class Director(firstName: String, lastName: String, yearOfBirth: Int) | |
| case class Film(title: String, yearOfRelease: Int, imdbRating: Double, director: Director) | |
| val eastwood = new Director("Clint", "Eastwood", 1930) | |
| val mcTiernan = new Director("John", "McTiernan", 1951) | |
| val nolan = new Director("Christopher", "Nolan", 1970) | |
| val someBody = new Director("Just", "Some Body", 1990) | |
| val memento = new Film("Memento", 2000, 8.5, nolan) |
| trait FooPlugin { | |
| def name: String = | |
| // Get rid of synthetic '$'s in generated class names for singleton objects: | |
| getClass.getSimpleName.filterNot(_ == '$') | |
| // TODO: Insert Plugin Methods | |
| } | |
| object FooPlugin1 extends FooPlugin | |
| object FooPlugin2 extends FooPlugin |
Keep in touch and up-to-date with the latest shapeless news here:
https://gitter.im/milessabin/shapeless
The shapeless codebase is on Miles' Github:
| # Switch to the "user package" directory on your hard drive: | |
| cd 'Library/Application Support/Sublime Text 3/Packages/User/' | |
| # Create a .sublime-keymap file containing the desired keyboard shortcut: | |
| echo '[{ "keys": ["ctrl+super+r"], "command": "reveal_in_side_bar" }]' > 'Custom Keys.sublime-keymap' |
| { | |
| "shell_cmd": "highlight -O rtf -t 2 -K 32 -k 'PragmataPro' --syntax scala --style slides $file_path/$file_name | pbcopy" | |
| } |
| scalaVersion := "2.11.2" | |
| resolvers += "Underscore Training" at "https://dl.bintray.com/underscoreio/training" | |
| libraryDependencies += "underscoreio" %% "doodle" % "0.1.0" | |
| initialCommands in console := """ | |
| |import doodle.core._ | |
| |import doodle.syntax._ | |
| |import doodle.jvm._ |