Feedback form:
Case studies:
package code | |
import cats.implicits._ | |
// Main.scala | |
object Main extends App { | |
val database = PersonDatabase.createTestDatabase | |
// 1. Write code to: |
/* | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
START OF CONFIGURATION | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
~~~~~~~~~~~~~~~~~~~~~~~~ | |
Configuration: Form URLs | |
~~~~~~~~~~~~~~~~~~~~~~~~ | |
You can get these from the address bar |
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
version: 2 | |
jobs: | |
build: | |
docker: | |
- image: circleci/openjdk:8-jdk | |
steps: | |
- checkout | |
- restore_cache: | |
key: scala-library-dependencies-{{ checksum "build.sbt" }} | |
- run: sbt test:compile |
package calc | |
sealed trait Term | |
case object Add extends Term | |
case object Sub extends Term | |
case object Mul extends Term | |
case object Div extends Term | |
case class Num(value: Int) extends Term | |
sealed trait Error |
First we installed Node.js, which is a command line application that lets you run JAvascript code outside of the browser. We installed Node 7.10.2 (which isn't the latest version).
When you install node.js you get two commands:
I hereby claim:
To claim this, I am signing this object:
trait HtmlWriter[A] { | |
def apply(value: A): String | |
} | |
object HtmlWriter { | |
def apply[A](implicit writer: HtmlWriter[A]): HtmlWriter[A] = | |
writer | |
def write[A](value: A)(implicit writer: HtmlWriter[A]): String = | |
writer.apply(value) |
This workshop will introduce shapeless, a library for generic programming in Scala. We will discover how to use shapeless to automatically create instances of type classes ("JSON encoder", "Equals", "Show", and so on) for any algebraic data type (case class or sealed trait) using a very small kernel of library code.