## LambdaConf - 2015

Explore the the fear of reaching out, having difficult conversations, and willingly extending ourselves to others looking to truly connect
Delivering a difficult message is like throwing a hand-grenade, coated with sugar, it will still do damage.
Choosing not to deliver a difficult message is like hanging on to a hand grenade once you've pulled the pin
Dealing constructively with tough topics strengthens and adds meaning to a relationship fold ~ replaces each 'thing' with a function
book: functional programming with bananas and barbed wire
maximum segment sum problem - Solve with functional, monadic bits of computation - instead of multiple map operations, compose mappings using 'fold-fusion', combining the map ops of one map into another whereas: foldr f z . map g is equivalent to foldr (f . g) z
monoids: carrier functions for list homomorphisms
functor: a type of mapping between categories, which is applied in category theory. Functors can be thought of as homomorphisms between categories.
monad: a structure that represents operations either nested or chained on a specific type.
Bird Meertens Formalism - a calculus for deriving programs from specifications data types in haskell are algebraic: a set of operations over some domain
Functions in Haskell are unary..a function accepting multiple args is actually multiple functions curried
Haskell function purity...same input -> same result
The more constrained your types the less constrained the functionality
Haskell IO uses IO interface, can see computations with side effects easily
Composition of functions is associative
Functional programming is all about transformations on immutable data Cipher: An algorithm for encoding/decoding some message
ROT13, a special case of the Caesar cipher, implemented in Cryptol:
caesar : {n} ([8], String n) -> String n caesar (s, msg) = [ shift x | x <- msg ] where map = [’A’ .. ’Z’] <<< s shift c = map @ (c - ’A’) How do we make the Ouroboros spit out his own tail, or, disrupt the endless perpetuation of mistakes of the past
Compatibility means deliberately repeating other peoples' mistakes
Scala intentionally repeats javas mistakes
Immutable files - lazily computed - safe for concurrent access
Pervasive file virtualization
Critical that data is lazier than metadata
Files recomputed automatically on demand - reactive files - continuous consistency

A var is a house for a bug
And its a safe bet, that your technical debt
Has the nicest house on the whole block
2.9
Application -> App (trait can be used to quickly turn objects into executable programs)
Using Application (legacy): 7seconds (not threadsafe)
Parallel collections...par method...4 cored machine...program runs neaarly 4x as fast using 'par'
Use Try.get (even thought Option.get is bad)
Implicit classes
Value classes: Used to avoid object allocation at runtime. Type safety of custom data types without runtime overhead.
Extension methods: allocation free
String interpolation --json and sql custom interpolations
2.10
Future...parallel, non-blocking, and async. Call back order is not deterministic
Start futures outside 'for comprehension'...collect results in 'fo'-comprehension;.
Future is read only placeholder for a result
Promise is a writable conatiner which completes a future
Modularization
Reflection, Macros(throw runtime errors at compiletime), and Quasiquotes ..Reified scala expressions
Predef.??? - for methods not implemented
2.11
Case classes with > 22 params
Colors in the REPL! Use: scala -Dcolors=true
2.12
Support java 8
Spores - Distributable, portable code closures. Send distributable, closures to the data. Dont match on options
Treat Option as a collection or Monad
Instead of: opt match { case Some(a) => a case None => "blah" } Use: opt.getOrElse("blah")
forall...returns true for none
Dont pattern match on boolean and single case
The most idiomatic way to use Option is to treat it as a collection or monad and use map, flatMap, filter, or foreach. A less-idiomatic way to use Option is via pattern matching
Dont throw exceptions, return them as programmable errors. Thrown exceptions can’t be returned through the stack or cross thread boundaries
Use Try rather than Either to return exceptions. Enhanced functional coding for Scala
Functor: Something that can be mapped over
Scalaz defines Functor instances for Tuples. (1, 2, 3) map {_ + 1} outputs: (Int, Int, Int) = (1,2,4)
Use Scalaz Monads to make IO ops pure and lazy
Make IO pure by not doing any IO (until you run the code). Such as: object Pure { def println(msg: String) = () => Predef.println(msg) }
Free monad is all about separating the structure of the computation from the interpreter that gives it meaning
Scalaz Either is: \/ , which is a disjunction. Left is -\/ Right is \/-
Validation, applicatve operator to combine results - Validation keeps going and reports back all failures - Not a monad, but an applicative functor -
Instead of chaining the result from first event to the next, Validation validates all events Compositional lib for stream processing -- r/w incrementally using constant memory - zip and merge I/O streams
Nondeterministic and concurrent processing: A computation may read from multiple input streams simultaneously, using whichever result comes back first, and a pipeline of transformation can allow for nondeterminism and queueing at each stage.
A topic is like a queue. but when you subscribe, you only get messages from that point forward

## Cool New Tools

Scalacheck - automated property-based testing for Scala apps
Https4s - minimal, idiomatic Scala interface for HTTP - http://http4s.org/
Scodec - combinator library for working with binary data
Spire - number types and numeric abstractions for Scala
axle - an embedded domain specific language in Scala for scientific computing
Doobie - a pure-functional database library for Scala
REPLesent - Presentations using Scala REPL
Cats - a simpler Scalaz - Lightweight, modular, and extensible library for functional coding