An overly-ambitious attempt to re-think the core calculus of dependent type theory by basing it on graphs as opposed to lambdas, Π-types, Σ-types, etc. The hope is that this might allow us to investigate dependency more closely, and allow us to refine programs to target different environments in an easier way than with traditional programming representations.
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
@* | |
* This template takes a single argument, a String containing a | |
* message to display. | |
*@ | |
@(message: String) | |
@main("The Interactive ABC Tutorial", "abc", "Main") { | |
<h1>The Interactive ABC Tutorial</h1> |
NOTE: This is a sketch of the proposal, many details need to be filled out and the scheme hasn't been implemented yet.
G |- T <: S
--------------------
G |- T#L <: S#L
------------------------------
G |- {L: X..Y, ...}#L <: Y
object DynamoReader { | |
def typeReader[A](f: (JsObject => JsResult[A])) = new Reads[A] { | |
def reads(json: JsValue): JsResult[A] = json match { | |
case obj: JsObject => f(obj) | |
case _ => JsError(Seq(JsPath() -> Seq(ValidationError("error.expected.jsobject")))) | |
} | |
} | |
} | |
object DynamoString { |
import sbtrelease._ | |
import ReleaseKeys._ | |
import Utilities._ | |
import ReleaseStateTransformations._ | |
val gitVersionString = """enablePlugins(GitVersioning) | |
git.baseVersion := "%s"""" | |
def writeVersion(st: State, versionString: String) { |
- Install autocomplete-plus and autocomplete-snippets plugins
- Add these snippets to your snippets.cson
- Try typing
u
and the LaTeX name of the symbol you want and you should get autocompletetion with a preview of the symbol
|----------------------------------------------------------------------------------------|--------------------| | |
| Object Header (64 bits) | State | | |
|-------------------------------------------------------|--------------------------------|--------------------| | |
| Mark Word (32 bits) | Klass Word (32 bits) | | | |
|-------------------------------------------------------|--------------------------------|--------------------| | |
| identity_hashcode:25 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Normal | | |
|-------------------------------------------------------|--------------------------------|--------------------| | |
| thread:23 | epoch:2 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Biased | | |
|-------------------------------------------------------|--------------------------------|--------------------| | |
| |
object Transducer { | |
type RF[R, A] = (R, A) => R | |
def apply[A, B](f: A => B) = | |
new Transducer[B, A] { | |
def apply[R](rf: RF[R, B]) = (r, a) => rf(r, f(a)) | |
} | |
} | |
import Transducer.RF |
Machinist Issue #2 asks:
Is it correct, that this stuff is completely obsolete now due to value classes or are there still some use cases? An example of using value class for zero-cost implicit enrichment: [...]
The short answer is that Machinist is not obsolete: value classes existed before the Machinist macros were implemented, and they do not solve the