Skip to content

Instantly share code, notes, and snippets.

View jedws's full-sized avatar

Jed Wesley-Smith jedws

View GitHub Profile
package com.atlassian.crowd.plugin.usermanagement.rest.controller;
import com.atlassian.fugue.Option;
import static com.atlassian.crowd.plugin.usermanagement.rest.controller.Visibility.Internal;
import static com.atlassian.fugue.Option.some;
class Main {
public static void main(String[] args) {
CreateComment comment1 = CreateComment.build(
trait Higher[F[_]]
trait Box[A]
object Box {
implicit def HigherBox = new Higher[Box] {}
}
object Foo {
val box = implicitly[Higher[Box]] // compiles fine !!!
package com.fayi.ftp
object CSVParser {
val ADDRESS = "ftp://mirrors.kernel.org/gnu/README.DESCRIPTIONS"
val ADDRESS2 = "ftp://ftp.gnu.org/README"
def main(args: Array[String]) {
def parse(s: Stream[String]) = {
val cells = (_: String).split(",")
@jedws
jedws / Schrödinger.scala
Created June 4, 2012 21:55 — forked from jroper/Schrödinger.scala
Scala would be more fun if it had one of these...
final case class Schrödinger[+A, +B](private a: => A, private b: => B) extends Either[A, B] {
private lazy val actual : Either[A, B] =
if (new Random().nextBoolean())
Left(a)
else
Right(b)
def isLeft = actual.isLeft
def isRight = actual.isRight
def left = actual.left