I hereby claim:
- I am andreaskostler on github.
- I am kandre1980 (https://keybase.io/kandre1980) on keybase.
- I have a public key ASAXdg4Wt3DUsCSjWq9LXIf6oCNka0lb1LbHvzYhbEyKMAo
To claim this, I am signing this object:
| // Super simple, recursive flatten | |
| // The _ means we have a weakly polymorphic type | |
| // i.e. we don't care about what type _ is (it will, or will not, be resolved later) | |
| // the type signature for flatMap on Seq is Seq[A] => (A => Seq[B]) => Seq[B] | |
| def flatten(s: Seq[_]): Seq[_] = s flatMap { | |
| case s: Seq[_] => flatten(s) // If s is a Seq, we recursively flatten | |
| case s => Seq(s) // If s is atomic, we're done; just package up s | |
| } | |
| // degenerate case |
I hereby claim:
To claim this, I am signing this object:
| package model | |
| import algebra.DeleteDealerErrors.SellIdError | |
| import cats.MonadError | |
| import play.api.libs.json._ | |
| import play.api.mvc.PathBindable | |
| import scala.util.Try | |
| final case class SellId(value: String) |
| object UnionTypes { | |
| private type ¬[A] = A => Nothing | |
| private type ¬¬[A] = ¬[¬[A]] | |
| private type ∈[S, T <: Disjunction] = ¬¬[S] <:< ¬[T#D] | |
| private type ∉[S, T <: Disjunction] = ¬¬[S] <:!< ¬[T#D] | |
| /** `S` is `T`. */ | |
| type Is[S, T] = ∈[S, OneOf[T]#Or[Nothing]] |
| object Def { | |
| import shapeless.{ =:!=, HNil, HList, Nat, Poly1, Succ, Witness } | |
| import shapeless.nat.{ _0 => D0, _1 => D1, _2 => D2, _3 => D3 } | |
| import shapeless.ops.nat.{ Diff, GT, LTEq, ToInt } | |
| import shapeless.ops.hlist.{ Mapper, ToTraversable, ZipConst } | |
| trait Value { | |
| def toShortString = ??? | |
| } | |
| object Value { |
| object Def { | |
| import shapeless.{ =:!=, HNil, HList, Nat, Poly1, Succ, Witness } | |
| import shapeless.nat.{ _0 => D0, _1 => D1, _2 => D2, _3 => D3 } | |
| import shapeless.ops.nat.{ Diff, GT, LTEq, ToInt } | |
| import shapeless.ops.hlist.{ Mapper, ToTraversable, ZipConst } | |
| trait Value { | |
| def toShortString = ??? | |
| } | |
| object Value { |
| object Abc { | |
| import shapeless.{ =:!=, Nat, Succ } | |
| import shapeless.nat.{ _0 => D0, _1 => D1, _2 => D2, _3 => D3 } | |
| import shapeless.ops.nat.{ Diff, GT, LTEq, ToInt } | |
| import shapeless.ops.hlist._ | |
| trait Value { | |
| def toShortString = ??? | |
| } | |
| object Value { |
| import shapeless._ | |
| trait Test { | |
| def ex[InL <: HList, H, T <: HList](in : InL)(implicit isHCons: IsHCons1.Aux[InL, List[H], T]) | |
| val ii: List[Int]::List[Int]::HNil | |
| ex(ii) | |
| } | |
| trait IsHCons1[L] { type H; type T <: HList} | |
| object IsHCons1 { |
| import shapeless._ | |
| import syntax._ | |
| import poly._ | |
| object LeftFolderOps { | |
| trait LeftFolder[C <: Coproduct, In, F] extends Serializable { | |
| def apply(c: C, in: In): In | |
| } |
| trait LeftFolder[C <: Coproduct, In, F] extends Serializable { | |
| def apply(c: C, in: In): In | |
| } | |
| object LeftFolder { | |
| def apply[C <: Coproduct, In, F](implicit folder: LeftFolder[C, In, F]) = folder | |
| implicit def hdLeftFolder[H, T <: Coproduct, In, F] | |
| (implicit f: Case2.Aux[F, In, H, In]): LeftFolder[H :+: T, In, F] = new LeftFolder[H :+: T, In, F] { | |
| def apply(c: H :+: T, in: In): In = c match { |