##Scala eXchange 2014 slides
collected by Adam Warski
Feel free to complete the list!
The Binary Compatibility Challenge by Martin Odersky
A Skeptic's Look at scalaz' "Gateway Drugs”: A Practical Exploration by Brendand McAdams
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
/** | |
* D Holbrook | |
* | |
* Code Club: PO1 | |
* | |
* (*) Define a binary tree data structure and related fundamental operations. | |
* | |
* Use whichever language features are the best fit (this will depend on the language you have selected). The following operations should be supported: | |
* | |
* Constructors |
package json | |
import reactivemongo.bson._ | |
import reactivemongo.bson.handlers.DefaultBSONHandlers._ | |
import play.api.libs.json._ | |
import play.api.libs.json.Json._ | |
import play.api.libs.json.util._ | |
import play.api.libs.json.Writes._ | |
import play.api.libs.functional.syntax._ |
import play.api.libs.json._ | |
import play.api.libs.functional.syntax._ | |
sealed trait Parent { | |
val typ: String | |
} | |
case class Foo(blabla: Long, override val typ: String = "foo") extends Parent |
#!/bin/sh | |
exec scala -savecompiled "$0" $@ | |
!# | |
// | |
// Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com> | |
// Modified 2014 AI2 <http://www.allenai.org> | |
// | |
// This script will check that the commit is correctly formatted. It only checks files that are to be committed. | |
// To be run this file should be at `.git/hooks/pre-commit`. |
##Scala eXchange 2014 slides
collected by Adam Warski
Feel free to complete the list!
The Binary Compatibility Challenge by Martin Odersky
A Skeptic's Look at scalaz' "Gateway Drugs”: A Practical Exploration by Brendand McAdams
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
.
/** | |
* Working with shapeless' records is great. However, you are limited to using only String, Integer, Boolean, and | |
* (package) Objects as singleton keys as the singleton machinery requires a stable point (I don't really fully | |
* understand this part but I have an intuition). I had asked if there was a way to use a tuple or case-class | |
* as a key in the shapeless gitter channel and no one really knew. | |
* | |
* I was reading the shapeless source for the Witness type and an idea came to mind: since we can use a package Object | |
* as a key, what if that key extends a trait (an abstract class can work as well)? Can we use those objects as | |
* singleton keys and access the values specified in the trait? | |
* |
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
tl;dr Generate a GPG key pair (exercising appropriate paranoia). Send it to key servers. Create a Keybase account with the public part of that key. Use your keypair to sign git tags and SBT artifacts.
GPG is probably one of the least understood day-to-day pieces of software in the modern developer's toolshed. It's certainly the least understood of the important pieces of software (literally no one cares that you can't remember grep's regex variant), and this is a testament to the mightily terrible user interface it exposes to its otherwise extremely simple functionality. It's almost like cryptographers think that part of the security comes from the fact that bad guys can't figure it out any more than the good guys can.
Anyway, GPG is important for open source in particular because of one specific feature of public/private key cryptography: signing. Any published software should be signed by the developer (or company) who published it. Ideally, consu