Skip to content

Instantly share code, notes, and snippets.

View odenzo's full-sized avatar

odenzo odenzo

  • 00:58 (UTC -04:00)
View GitHub Profile

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
@etaty
etaty / JsonCirceBodyParser.scala
Created November 5, 2015 17:30
json circe play framework body parser
package utils
import java.nio.ByteBuffer
import cats.data.Xor
import io.circe.Json
import play.api.http.LazyHttpErrorHandler
import play.api.http.Status._
import play.api.libs.iteratee.{Iteratee, Traversable}
import play.api.mvc.BodyParsers.parse._
@kevinwright
kevinwright / scaladays2014.md
Last active March 8, 2018 20:25
Scaladays 2014 slides

As compiled by Kevin Wright a.k.a @thecoda

(executive producer of the movie, and I didn't even know it... clever huh?)

please, please, please - If you know of any slides/code/whatever not on here, then ping me on twitter or comment this Gist!

This gist will be updated as and when I find new information. So it's probably best not to fork it, or you'll miss the updates!

Monday June 16th

@loicdescotte
loicdescotte / Forcomptran.md
Last active May 27, 2023 06:27
Scala for comprehension translation helper

Scala for comprehension translation helper

"For comprehension" is a another syntaxe to use map, flatMap and withFilter (or filter) methods.

yield keyword is used to aggregate values in the resulting structure.

This composition can be used on any type implementing this methods, like List, Option, Future...