import java.time.Instant; | |
import org.threeten.extra.Interval; | |
import com.fasterxml.jackson.annotation.JsonAutoDetect; | |
import com.fasterxml.jackson.annotation.JsonCreator; | |
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
// Exclude JavaBean properties that are not part of the state |
package com.lightbend.conductr.eslite | |
import javax.inject.Named | |
import akka.NotUsed | |
import akka.actor.ActorRef | |
import akka.pattern.ask | |
import com.fasterxml.jackson.databind.node.ObjectNode | |
import com.google.inject.Inject | |
import com.lightbend.conductr.eslite.dto._ |
A primer/refresher on the category theory concepts that most commonly crop up in conversations about Scala or FP. (Because it's embarassing when I forget this stuff!)
I'll be assuming Scalaz imports in code samples, and some of the code may be pseudo-Scala.
A functor is something that supports map
.
/** | |
* Pretty prints a Scala value similar to its source represention. | |
* Particularly useful for case classes. | |
* @param a - The value to pretty print. | |
* @param indentSize - Number of spaces for each indent. | |
* @param maxElementWidth - Largest element size before wrapping. | |
* @param depth - Initial depth to pretty print indents. | |
* @return | |
*/ | |
private def prettyPrint(a: Any, indentSize: Int = 2, maxElementWidth: Int = 30, depth: Int = 0): String = { |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
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
#!/bin/bash | |
# | |
# ========================================================================= | |
# Copyright 2014 Rado Buransky, Dominion Marine Media | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
// Questions about \/ and Validation | |
object scalaz { | |
/* | |
This explanation might help. This is a compilable source file with revisions | |
available at https://gist.github.com/tonymorris/8263051 | |
Fact: All monads are applicative functors. As has been seen we can witness the | |
`Applicative` that arises from the `Monad` primitives. Let's illustrate this: |