Skip to content

Instantly share code, notes, and snippets.

View windymelt's full-sized avatar
😄
Working from Home

Windymelt windymelt

😄
Working from Home
View GitHub Profile
@windymelt
windymelt / requiem.scala.sc
Created September 14, 2024 00:29
粛聖!! ロリ神レクイエム☆
// DSL
trait 監獄[Repr]:
def 入獄(罪人たち: Seq[(Int, 罪人[String])]): Unit
def 点呼(): Repr
trait 罪人[Repr]:
def 触る(): Repr
def 逮捕()(using 監獄[Repr]): Repr
def ごめんなさい(): Repr
import cats.effect.kernel.Resource
import cats.effect.IO
import cats.data.EitherT
trait Client {
def get(uri: String): IO[String]
}
val client: Resource[IO, Client] = Resource.pure(new {
def get(uri: String): IO[String] = IO.pure("result")
})
@windymelt
windymelt / vector.scala.sc
Created April 2, 2024 13:51
Vector APIを使った
//> using scala 3.4.0
//> using dep "com.outr::scribe::3.13.2"
// run via:
// scala-cli -J --add-modules -J jdk.incubator.vector -J -Xmx16G vector.scala.sc
import jdk.incubator.vector.*
import scribe._
def mult2a(arr: Array[Double]): Array[Double] = arr.map(_ * 1.618)
//> using scala 3.3.0
import java.awt.Desktop
import java.net.URI
if (Desktop.isDesktopSupported) {
Desktop.getDesktop.browse(new URI("https://scala-cli.virtuslab.org/"))
}
//> using scala 3.3.0
//> using dep org.http4s::http4s-ember-server:0.23.23
//> using dep org.http4s::http4s-dsl:0.23.23
import cats.effect._
import com.comcast.ip4s._
import org.http4s.HttpRoutes
import org.http4s._
import org.http4s.dsl.io._
import org.http4s.ember.server._
//> using scala 3.3.0
//> using dep org.http4s::http4s-ember-server:0.23.23
//> using dep org.http4s::http4s-dsl:0.23.23
//> using dep org.http4s::http4s-circe:0.23.23
//> using dep "io.circe::circe-generic:0.14.5"
//> using dep "io.circe::circe-literal:0.14.5"
import cats.effect._
import com.comcast.ip4s._
import org.http4s.HttpRoutes
//> using scala 3.3.0
//> using dep org.http4s::http4s-ember-server:0.23.23
//> using dep org.http4s::http4s-dsl:0.23.23
import cats.effect._
import com.comcast.ip4s._
import org.http4s.HttpRoutes
import org.http4s._
import org.http4s.dsl.io._
import org.http4s.ember.server._
//> using scala 3.3.0
//> using dep org.http4s::http4s-ember-server:0.23.23
//> using dep org.http4s::http4s-dsl:0.23.23
import cats.effect._
import com.comcast.ip4s._
import org.http4s.HttpRoutes
import org.http4s._
import org.http4s.dsl.io._
import org.http4s.ember.server._
// using scala "3.1"
@main def main(): Unit = {
println("Hello, Carbon!")
}

Keybase proof

I hereby claim:

  • I am windymelt on github.
  • I am windymelt (https://keybase.io/windymelt) on keybase.
  • I have a public key ASBznwbtc7D0PGz1blwHP6d8M61UE9jpekYp4eQ4DTz0dwo

To claim this, I am signing this object: