This file contains hidden or 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 ZioToSparkIterator { | |
def toIterator[E, A](q: UIO[stream.Stream[E, A]]): Iterator[Either[E, A]] = new Iterator[Either[E, A]] { | |
sealed trait State | |
case object Running extends State | |
sealed trait ValueOrClosed extends State | |
case object Closed extends ValueOrClosed | |
case class Value(value: Either[E, A]) extends ValueOrClosed |
This file contains hidden or 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
implicit val qTree:DeepEqual[QTree[Unit]] = DeepEqual.anyDeepEqual | |
//DeepEqual.gen[DescribeLong] | |
DeepEqual.gen[ParkaAnalysis].explainNotEqual(pa,paFromJson).foreach(println) | |
assert(pa == paFromJson) | |
} | |
} |
This file contains hidden or 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
case class Person(name: String, age: Int) | |
{ | |
val n:Option[String] = Some("toto") | |
val a:Option[Int] = None | |
val p:Option[Person] = Person.apply.app(name = n, age = a) | |
} | |
{ |
This file contains hidden or 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 2017-2019 John A. De Goes and the ZIO Contributors | |
* | |
* 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 hidden or 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 2017-2019 John A. De Goes and the ZIO Contributors | |
* | |
* 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 hidden or 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 2017-2019 John A. De Goes and the ZIO Contributors | |
* | |
* 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 hidden or 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
diff --git a/core/shared/src/main/scala/scalaz/zio/clock/package.scala b/core/shared/src/main/scala/scalaz/zio/clock/package.scala | |
index 5691082e..33cfcb61 100644 | |
--- a/core/shared/src/main/scala/scalaz/zio/clock/package.scala | |
+++ b/core/shared/src/main/scala/scalaz/zio/clock/package.scala | |
@@ -17,28 +17,37 @@ | |
package scalaz.zio | |
import scalaz.zio.duration.Duration | |
- | |
import java.util.concurrent.TimeUnit |
This file contains hidden or 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
val ss: SparkSession | |
val df: DataFrame | |
import ss.implicits._ | |
trait NotTypeColumn[C] | |
object NotTypeColumn { | |
implicit def notc[C <: org.apache.spark.sql.Column]:NotTypeColumn[C] = new NotTypeColumn[C] {} |
This file contains hidden or 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 io.univalence | |
import io.univalence.Fk.Encoder.{BindedTypedExprEncoder, SimpleEncoder} | |
import io.univalence.Fk.Expr.Ops | |
import io.univalence.Fk.TypedExpr.TypedOr | |
import org.json4s.JsonAST.{JArray, JString, JValue} | |
import scala.language.{dynamics, implicitConversions} | |
object Fk { |
This file contains hidden or 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
def day1(input:Seq[Int]): (Int, Int) = { | |
val part1 = 0 + input.sum | |
val part2 = { | |
val freq: Seq[Int] = Stream.continually(input).flatten | |
val states: Seq[Int] = freq.scanLeft(0)(_ + _) | |
val find: Either[Int, Set[Int]] = foldLeftUntil(states)(Set.empty[Int])( | |
(set, a) => if (set(a)) Left(a) else Right(set + a)) |