- 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
#!/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 |
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
https://www.usenix.org/legacy/events/hotos07/tech/full_papers/dolstra/dolstra.pdf | |
https://edolstra.github.io/pubs/phd-thesis.pdf | |
https://nixos.org/manual/nix/stable/ | |
https://nixos.org/guides/nix-pills/index.html | |
https://nix.dev/ | |
https://wiki.nikitavoloboev.xyz/package-managers/nix | |
https://edolstra.github.io/pubs/nixos-jfp-final.pdf | |
https://nixos.org/docs/SCR-2005-091.pdf | |
https://medium.com/@MrJamesFisher/nix-by-example-a0063a1a4c55 | |
https://scrive.github.io/nix-workshop/01-getting-started/01-introduction.html |
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 "software.amazon.smithy:smithy-model:1.26.4" | |
//> using scala "2.13.10" | |
import software.amazon.smithy.model.Model | |
import software.amazon.smithy.model.neighbor.NeighborProvider | |
import software.amazon.smithy.model.shapes.ShapeId | |
import scala.jdk.CollectionConverters._ | |
object demo extends App { |
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 "software.amazon.smithy:smithy-model:1.26.4" | |
//> using lib "com.disneystreaming.smithy4s:smithy4s-protocol:0.17.1" | |
//> using scala "2.13.10" | |
import software.amazon.smithy.model.Model | |
import software.amazon.smithy.model.neighbor.Walker | |
import software.amazon.smithy.model.shapes.ShapeId | |
import scala.jdk.CollectionConverters._ | |
import software.amazon.smithy.model.neighbor.NeighborProvider | |
import software.amazon.smithy.model.neighbor.Relationship | |
import software.amazon.smithy.model.shapes.Shape |
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 scala.compiletime.ops.int.{>, +, *} | |
import scala.compiletime.ops.string.{Length, Substring, CharAt} | |
import Tuple.Map | |
object StringOps { | |
type IndexOfRec[Haystack <: String, Needle <: String, I <: Int] = | |
((I + Length[Needle]) > Length[Haystack]) match { | |
case true => -1 | |
case false => | |
Substring[Haystack, I, I + Length[Needle]] match { |
NewerOlder