- 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
class A | |
class A2 extends A | |
class B | |
trait M[X] | |
// | |
// Upper Type Bound | |
// | |
def upperTypeBound[AA <: A](x: AA): A = x |
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
.highlight { background-color: #ffffcc } | |
.highlight .c { color: #586E75 } /* Comment */ | |
.highlight .err { color: #93A1A1 } /* Error */ | |
.highlight .g { color: #93A1A1 } /* Generic */ | |
.highlight .k { color: #859900 } /* Keyword */ | |
.highlight .l { color: #93A1A1 } /* Literal */ | |
.highlight .n { color: #93A1A1 } /* Name */ | |
.highlight .o { color: #859900 } /* Operator */ | |
.highlight .x { color: #CB4B16 } /* Other */ | |
.highlight .p { color: #93A1A1 } /* Punctuation */ |
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
/** GADTs in Scala and their limitations */ | |
/** Background: what is an algebraic data type (ADT) ? | |
* ADT: (possibly) recursive datatype with sums and products | |
* In scala - a trait with case classes (case class is product, subtyping is sum) | |
*/ | |
/** Motivation: untyped embedded DSL doesn't prevent nonsensical expressions */ | |
sealed trait Expr { | |
def apply(other: Expr) = Ap(this, other) |
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 AllExamples extends App { | |
import shapeless._ | |
final class All[L <: HList](val values: L) { | |
def apply[A](implicit selector: Selector[L, A]): A = values.select[A] | |
} | |
object All { | |
// package a value of type A, convertible to type B, into an HList containing just B |
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
<!-- copy this to YOUR_THEME.tmTheme--> | |
<dict> | |
<key>name</key> | |
<string>diff: deleted</string> | |
<key>scope</key> | |
<string>markup.deleted</string> | |
<key>settings</key> | |
<dict> | |
<key>background</key> | |
<string>#EAE3CA</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
/* | |
* 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
package org.catch22.amazonws | |
/** | |
* This class derives from https://github.com/keplar/scalapac | |
* It's released under the Apache licence V2.0 | |
* Copyright (c) 2012 Orderly Ltd. All rights reserved. | |
* Copyright (c) 2012 Mark Lister | |
* | |
*/ |
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
/** Constructing "singleton types" from compile-time literals | |
* | |
* val x = Example.foo(42) | |
* val y: x.T = 42 // compiles | |
* val z: x.T = 43 // doesn't | |
* | |
*/ | |
package s | |
import scala.language.experimental.macros |
OlderNewer