- For fun
- For your proprietary DSL
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
//> using dep org.http4s::http4s-ember-server::0.23.28 | |
import cats.effect.IO | |
import cats.effect.IOApp | |
import cats.effect.std.UUIDGen | |
import cats.syntax.all.* | |
import fs2.concurrent.Topic | |
import org.http4s.HttpApp | |
import org.http4s.ember.server.EmberServerBuilder | |
import org.http4s.websocket.WebSocketFrame |
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
runner.dialect = scala3 | |
runner.dialectOverride.allowSignificantIndentation = false | |
# allows `if x then y` | |
runner.dialectOverride.allowQuietSyntax = true |
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
//> using option -Ykind-projector | |
trait Demo { | |
type LA | |
type LB | |
type RA | |
type RB | |
def x(using | |
laEqLb: LA =:= LB, | |
raEqRb: RA =:= RB |
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
//> using dep org.http4s::http4s-ember-server:0.23.27 | |
//> using dep org.http4s::http4s-dsl:0.23.27 | |
//> using dep org.http4s::http4s-circe:0.23.27 | |
//> using dep com.github.tarao::record4s-circe:0.13.0 | |
//> using option -Wunused:all | |
import cats.effect.IO | |
import cats.effect.IOApp | |
import com.comcast.ip4s.* | |
import com.github.tarao.record4s.% | |
import com.github.tarao.record4s.select |
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
#!/bin/bash | |
set -euo pipefail | |
# You'll have to change this, also see note about caveat below | |
SDK_PATH=/Users/kubukoz/Developer/PlaydateSDK/C_API | |
rm -rf HelloWorld.pdx || true | |
rm Source/pdex.elf || true |
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
// compiles | |
//> using scala "3.3.1" | |
import scala.annotation.tailrec | |
case class Opt[A](value: A | Null) { | |
inline def flatMap[B](inline f: A => Opt[B]): Opt[B] = | |
if (value == null) | |
Opt(null) | |
else |
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
//> using scala "3.2.2" | |
//> using lib "co.fs2::fs2-io:3.6.1" | |
//> using lib "io.circe::circe-core:0.14.5" | |
//> using lib "io.circe::circe-parser:0.14.5" | |
import cats.data.NonEmptyList | |
import cats.effect.IO | |
import cats.effect.IOApp | |
import cats.implicits.* | |
import cats.kernel.Order | |
import fs2.io.file.Files |
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
//> using lib "co.fs2::fs2-core:3.7.0-RC4" | |
import cats.effect.IOApp | |
import cats.effect.IO | |
import scala.concurrent.duration._ | |
import cats.effect.std.UUIDGen | |
import cats.implicits._ | |
import scala.util.Random | |
import fs2.concurrent.Signal | |
object Demo extends IOApp.Simple { |
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
//> using scala "2.13.10" | |
//> using lib "co.fs2::fs2-io:3.5.0" | |
//> using option "-Wunused:imports" | |
import cats.effect.IO | |
import cats.effect.IOApp | |
import cats.effect.kernel.Resource | |
import cats.implicits._ | |
import fs2.io.file.Files | |
import fs2.io.file.Path |
NewerOlder