Skip to content

Instantly share code, notes, and snippets.

Long Cao longcao

Block or report user

Report or block longcao

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Applied-FP-with-Scala.md

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@noelmarkham
noelmarkham / imports.md
Last active Jan 5, 2017
Cats imports cheat sheet
View imports.md
import... What it imports
cats.std.type Typeclass instances for standard library type (think List, Option)
cats.syntax.type “Enhanced” methods for type (.toRightXor etc)
cats.data.type Imports a type not part of the standard library (think Xor, Kleisli) and its typeclass instances
View sbt_options.txt
scalacOptions ++= Seq(
// "-Xprint:typer", // Turn this on if WartRemover acts up, to see full syntax tree
"-deprecation",
"-encoding", "UTF-8", // yes, this is 2 args
"-feature",
"-unchecked",
"-Xfatal-warnings", // Treat Warnings as Errors
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code", // N.B. doesn't work well with the ??? hole
@cvogt
cvogt / gist:9239494
Last active Sep 9, 2019
Slick app architecture cheat sheet
View gist:9239494
// Please comment in case of typos or bugs
import scala.slick.driver.H2Driver._
val db = Database.for...(...)
case class Record( ... )
class Records(tag: Tag) extends Table[Record](tag,"RECORDS"){
...
def * = ... <> (Record.tupled,Record.unapply)
// place additional methods here which return values of type Column
You can’t perform that action at this time.