This file contains 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
2023.07.14 12:33:50 INFO Started: Metals version 0.11.12 in workspace '/home/miles/projects/gsp-graphql' for client Neovim 0.9.1. | |
Jul 14, 2023 12:33:50 PM org.flywaydb.core.internal.license.VersionPrinter printVersionOnly | |
INFO: Flyway Community Edition 9.16.3 by Redgate | |
Jul 14, 2023 12:33:50 PM org.flywaydb.core.internal.license.VersionPrinter printVersion | |
INFO: See release notes here: https://rd.gt/416ObMi | |
Jul 14, 2023 12:33:50 PM org.flywaydb.core.internal.license.VersionPrinter printVersion | |
INFO: | |
Jul 14, 2023 12:33:50 PM org.flywaydb.core.internal.database.base.BaseDatabaseType createDatabase | |
INFO: Database: jdbc:h2:file:/home/miles/projects/gsp-graphql/.metals/metals (H2 2.1) | |
Jul 14, 2023 12:33:50 PM org.flywaydb.core.internal.command.DbValidate validate |
This file contains 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
java.net.ConnectException: Connection refused | |
| => sat java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.checkConnect(Native Method) | |
at java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.finishConnect(UnixAsynchronousSocketChannelImpl.java:252) | |
at java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.finish(UnixAsynchronousSocketChannelImpl.java:198) | |
at java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.onEvent(UnixAsynchronousSocketChannelImpl.java:213) | |
at java.base/sun.nio.ch.EPollPort$EventHandlerTask.run(EPollPort.java:306) | |
at java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112) | |
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) | |
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) | |
at java.base/java.lang.Thread.run(Thread.java:829) |
This file contains 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
import shapeless._ | |
import ops.hlist.Tupler | |
trait TupleGeneric[C <: Product] extends Serializable { | |
type Repr <: Product | |
def to(t : C) : Repr | |
def from(r : Repr) : C | |
} |
This file contains 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
scala> import shapeless._, syntax.singleton._, record._ | |
import shapeless._ | |
import syntax.singleton._ | |
import record._ | |
scala> object ->> { | |
| def unapply[K, V](f: FieldType[K, V])(implicit k: Witness.Aux[K]) = Option((k.value, f: V)) | |
| } | |
defined module $minus$greater$greater |
This file contains 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
miles@tarski:~% cs launch scala3-repl | |
scala> trait A | |
| trait B | |
| type M[X] = X match | |
| case A => Int | |
| case B => String | |
| | |
// defined trait A | |
// defined trait B |
This file contains 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
import shapeless._ | |
object CaseClassMergeDemo extends App { | |
import mergeSyntax._ | |
case class Foo(i: Int, s: String, b: Boolean) | |
case class Bar(b: Boolean, s: String) | |
val foo = Foo(23, "foo", true) | |
val bar = Bar(false, "bar") |
This file contains 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
import cats.{Applicative, Monad} | |
import cats.implicits._ | |
abstract class Foo[+M[_[_]], F[_]](implicit val M: M[F]) | |
trait Bar[F[_]] extends Foo[Applicative, F] { def bar = Applicative[F] } | |
trait Baz[F[_]] extends Foo[Monad, F] { def baz = Monad[F] } | |
class User[F[_]: Monad] extends Bar[F] with Baz[F] | |
object Test { |
This file contains 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
import cats.{Applicative, Monad} | |
import cats.implicits._ | |
abstract class Foo[+M[_[_]], F[_]](implicit val M: M[F]) | |
trait Bar[F[_]] extends Foo[Applicative, F] { def bar = Applicative[F] } | |
trait Baz[F[_]] extends Foo[Monad, F] { def baz = Monad[F] } | |
class User[F[_]: Monad] extends Bar[F] with Baz[F] | |
object Test { |
This file contains 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 unexpected : Nothing = sys.error("Unexpected invocation") | |
// Encoding for "A is not a subtype of B" | |
trait <:!<[A, B] | |
// Uses ambiguity to rule out the cases we're trying to exclude | |
implicit def nsub[A, B] : A <:!< B = null | |
implicit def nsubAmbig1[A, B >: A] : A <:!< B = unexpected | |
implicit def nsubAmbig2[A, B >: A] : A <:!< B = unexpected |
This file contains 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
trait Companion[T] { | |
type C | |
def apply() : C | |
} | |
object Companion { | |
implicit def companion[T](implicit comp : Companion[T]) = comp() | |
} | |
object TestCompanion { |
NewerOlder