I hereby claim:
- I am jmccance on github.
- I am jmccance (https://keybase.io/jmccance) on keybase.
- I have a public key ASChjyd2Gnzghm-wPKqki7gaRF_cZHnHnmX5Ztuvw9nXwQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
package examples | |
import shapeless._ | |
import shapeless.labelled.FieldType | |
// First we need a typeclass to demo shapeless with. This one just handles converting things | |
// to strings. | |
trait Show[A] { | |
def apply(a: A): String | |
} |
import scalaz._ | |
import scalaz.Scalaz._ | |
import scala.language.higherKinds | |
object Fizzbuzz extends App { | |
def nums = Stream.from(1).map(_.toString) | |
def every[A: Monoid](n: Int)(a: A): Stream[A] = | |
Stream.fill(n - 1)(Monoid[A].zero) ++ a #:: every(n)(a) |
package net.jmccance.proofpoint | |
import scala.util.parsing.combinator._ | |
object ProofPoint extends App { | |
object ProofPointParser extends RegexParsers { | |
def character: Parser[String] = """.""".r ^^ (_.toString) | |
def slash: Parser[String] = "_" ^^ (_ => "/") | |
def encodedCharacter: Parser[String] = |
trait Greeting { | |
def greeting: String | |
} | |
trait Greeter { | |
this: Greeting => | |
def greet() = greeting | |
} |
final List<String> fullNames = new ArrayList<>(); | |
for (Name name : names) { | |
fullNames.add(String.format("%s %s", name.getFirst(), name.getLast())); | |
} |