If you'd like to experiment with Terraform on macOS locally, a great provider for doing so is the Docker provider. You can get set up in a few simple steps, like so:
Install Docker for Mac if you have not already.
object UserEntityModule { | |
case class UserEntityF[F[_], G[_]](id: G[Option[Long]] = None, username: F[String], password: F[String]) | |
type Id[A] = A | |
type Forget[A] = Unit | |
// You can also just use Option if you don't care | |
// for the domain-specific type | |
sealed trait Updatable[+A] { | |
def foreach(f : A => Unit): Unit = this match { |
If you'd like to experiment with Terraform on macOS locally, a great provider for doing so is the Docker provider. You can get set up in a few simple steps, like so:
Install Docker for Mac if you have not already.
package com.dwolla.sbt.cloudformation | |
import com.dwolla.awssdk.cloudformation.CloudFormationClient | |
import com.dwolla.sbt.cloudformation.CloudFormationStackParsers._ | |
import sbt.IO.{read, utf8} | |
import sbt.Keys._ | |
import sbt._ | |
import scala.language.{implicitConversions, postfixOps} |
// These lines go in ~/.sbt/0.13/global.sbt | |
watchSources ++= ( | |
(baseDirectory.value * "*.sbt").get | |
++ (baseDirectory.value / "project" * "*.scala").get | |
++ (baseDirectory.value / "project" * "*.sbt").get | |
) | |
addCommandAlias("rtu", "; reload ; test:update") | |
addCommandAlias("rtc", "; reload ; test:compile") | |
addCommandAlias("ru", "; reload ; update") |
Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.
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
// allows converting one class to another by providing missing fields | |
object convert { | |
@annotation.implicitNotFound(""" | |
You have not provided enough arguments to convert from ${In} to ${Out}. | |
${Args} | |
""") | |
trait Convertible[Args, In, Out] { | |
def apply(args: Args, in: In): Out | |
} |
import slick.driver.H2Driver.api._ | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent.Await | |
import scala.concurrent.duration._ | |
object EnrichExample extends App { | |
sealed case class Flag(val value: Boolean) |
import scala.annotation.tailrec | |
object Backtracking { | |
trait Problem { | |
type Node | |
trait Result | |
case object Rejected extends Result |
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
package slicks.docs.dao | |
import scala.slick.driver.PostgresDriver.simple._ | |
import scala.slick.driver._ | |
trait Profile { | |
val profile: JdbcProfile | |
} |