- Get a GitHub account: https://github.com/
- Github > Dashboard > New Repository ... https://github.com/repositories/new
- Enter a Project Name and Description; click "Create Repository"
- On the project page ignore the suggested setup instructions... instead click on the "Admin" button
- Check the "GitHub Pages" checkbox... You'll get a popup.
- Click the "Automatic GitHub page Generator" button.
- Choose a funky colour... or go safe with just white... then click "Create Page" button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test_shapeless | |
object DI { | |
import shapeless._ | |
trait Injecter[L <: HList, A] { | |
def apply(l: L) : A | |
} | |
trait InjecterAux[L <: HList, A] { |
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
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@* | |
* 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* We can use the Scala type system (with help from Miles Sabin's Shapeless | |
* library) to solve the bank account number validation problem in the second | |
* user story of the KataBankOCR kata on Coding Dojo: | |
* | |
* http://codingdojo.org/cgi-bin/wiki.pl?KataBankOCR | |
* | |
* By Travis Brown in response to a question by Paul Snively on the Shapeless | |
* Dev mailing list: | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2012 Miles Sabin | |
* | |
* 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 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sbtrelease._ | |
import ReleaseKeys._ | |
import Utilities._ | |
import ReleaseStateTransformations._ | |
val gitVersionString = """enablePlugins(GitVersioning) | |
git.baseVersion := "%s"""" | |
def writeVersion(st: State, versionString: String) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |