I hereby claim:
- I am mjhopkins on github.
- I am mjhopkins (https://keybase.io/mjhopkins) on keybase.
- I have a public key whose fingerprint is CDD5 00B6 B918 11BB D027 5160 0888 F607 EE67 1CE8
To claim this, I am signing this object:
| {-# LANGUAGE DerivingVia #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| {-# LANGUAGE OverloadedLists #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE StandaloneDeriving #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| {-# LANGUAGE TypeFamilyDependencies #-} | |
| {-# LANGUAGE UndecidableInstances #-} |
| {-# LANGUAGE LambdaCase #-} | |
| {-# LANGUAGE PatternSynonyms #-} | |
| {-# LANGUAGE ViewPatterns #-} | |
| module AndPatterns where | |
| pattern DivBy3 :: Integral i => i | |
| pattern DivBy3 <- ((`mod` 3) -> 0) | |
| pattern DivBy5 :: Integral i => i |
I hereby claim:
To claim this, I am signing this object:
| module EvenOdd | |
| data Even : (n : Nat) -> Type where | |
| ZeroIsEven : Even 0 | |
| SuccSuccEven : Even n -> Even (S (S n)) | |
| data Odd : (n : Nat) -> Type where | |
| OneIsOdd : Odd 1 | |
| SuccSuccOdd : Odd n -> Odd (S (S n)) |
| sealed trait Role[N <: Entity] | |
| case object VIP extends Role[Customer] | |
| case object Shopper extends Role[Customer] | |
| case object Manager extends Role[Staff] | |
| case object Employee extends Role[Staff] | |
| sealed trait Entity |
| package api | |
| import shapeless.{Succ, _0, Nat} | |
| import shapeless.nat._2 | |
| trait BasicDefinitions { | |
| // type level booleans | |
| sealed trait Flag | |
| trait On extends Flag | |
| trait Off extends Flag |
| object CreateSequence { | |
| import com.github.nscala_time.time.Implicits._ | |
| import Sequences._ | |
| val seq: Seq3[Int, String, Double] = an[Int].within(5.minutes)[String].within(10.minutes)[Double] | |
| } | |
| object Sequences { | |
| def an[A] = new SeqBuilder[A] | |
| def a[A] = new SeqBuilder[A] |
| object FlattenTuple { | |
| import shapeless._ | |
| import ops.tuple.FlatMapper | |
| import syntax.std.tuple._ | |
| trait LowPriorityFlattenTuple extends Poly1 { | |
| implicit def default[T] = at[T](Tuple1(_)) | |
| } |
| import scala.util.matching.Regex | |
| import scalaz._ | |
| import Scalaz._ | |
| import java.io.File | |
| /* | |
| Process a file containing <key, string, float> columns and print some stats on it. | |
| Let's assume the columns are separated by tab characters. | |
| */ |
| import com.google.protobuf.GeneratedMessage | |
| import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.{RenameRequestProto, AppendResponseProto} | |
| import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.ClientReadStatusProto | |
| import scalaz.{Tag, @@} | |
| /* | |
| Type class usage demo | |
| */ | |
| object byteArrayable { |