Skip to content

Instantly share code, notes, and snippets.

View i-am-the-slime's full-sized avatar
🪝

Mark Eibes i-am-the-slime

🪝
View GitHub Profile
@i-am-the-slime
i-am-the-slime / judge.scala
Created April 21, 2026 14:49
Scala DV Judge PoC — evaluates DVs and maps all 16 proto fields
//> using scala 3.5
//> using jar "dv_3_latest.jar"
//> using dep "org.typelevel::cats-effect:3.7.0"
//> using dep "com.lihaoyi::ujson:4.0.0"
//> using dep "com.thesamet.scalapb::scalapb-runtime:1.0.0-alpha.3"
import cats.effect.{IO, IOApp}
import cats.syntax.all.*
import com.doordash.dv.DVClient
import com.doordash.dv.entity.*
@i-am-the-slime
i-am-the-slime / test213.scala
Created April 21, 2026 14:49
Scala DV Client PoC — evaluation, typed get, exposure logging (Scala 2.13)
//> using scala 2.13
//> using jar "dv_2.13.jar"
//> using dep "org.typelevel::cats-core:2.12.0"
//> using dep "org.typelevel::cats-effect:3.5.4"
//> using dep "com.lihaoyi::ujson:4.0.0"
//> using dep "com.thesamet.scalapb::scalapb-runtime:1.0.0-alpha.3"
import cats.effect.{IO, IOApp, Resource}
import cats.syntax.all._
import com.doordash.dv.DVClient
@i-am-the-slime
i-am-the-slime / test3.scala
Created April 21, 2026 14:49
Scala DV Client PoC — evaluation, typed get, exposure logging (Scala 3)
//> using scala 3.5
//> using jar "dv_3.jar"
//> using dep "org.typelevel::cats-core:2.12.0"
//> using dep "org.typelevel::cats-effect:3.5.4"
//> using dep "com.lihaoyi::ujson:4.0.0"
//> using dep "com.thesamet.scalapb::scalapb-runtime:1.0.0-alpha.3"
import cats.effect.{IO, IOApp, Resource}
import cats.syntax.all.*
import com.doordash.dv.DVClient
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBH+PGmOOSfcfU5B2KF3PSbmahEka7QeLOH/FhpRJx2JwBu8w0M7dnPryIZulO3ErPsX2r+vFDq8+YHROexI7ZlE= Github-SSH-Key@secretive.YM7QTMXPD9Mac.local
@i-am-the-slime
i-am-the-slime / ObjectMap.purs
Last active February 3, 2024 17:12
Object that allows using any String newtype as the keys
module Sentence.Biz.Types.ObjectMap
( ObjectMap(..)
, empty
, isEmpty
, size
, singleton
, insert
, lookup
, toUnfoldable
, toAscUnfoldable
module BuildTime.GetMDXFiles where
import Prelude
import Node.FS.Aff (readTextFile, readdir)
import Data.Foldable (for_)
import Node.Glob.Basic (expandGlobsCwd)
import BuildTime.MDXBundler (EsbuildOptions, Extension(Extension), RehypePlugin, RemarkPlugin, addLoader, addRehypePlugins, addRemarkPlugins, bundleMDX, setPlatform)
import Node.Encoding (Encoding(..))
import Debug (spy)
import Effect.Aff (launchAff_)
module GraphQL.FunDeps where
import Prelude
import Data.Either (Either(..))
import Data.Foldable (foldMap)
import Data.Generic.Rep (class Generic)
import Data.Maybe (Maybe(..))
import Data.Semigroup.Foldable (intercalateMap)
import Data.String as String
module Main where
import Prelude
import Effect (Effect)
import TryPureScript (p, render, text)
import Data.Generic.Rep (class Generic, Constructor, Sum(..), from)
import Data.Reflectable (class Reflectable, reflectType)
import Type.Proxy (Proxy(..))

Motivation

Let's say we have the following data:

hobby :: { name :: String }
hobby = { name: "Football" }

Before visible type applications we could write this:

module SelectionManager where
import Yoga.Prelude.View
import Data.Set (Set)
import Data.Set as Set
import Hooks.UseSelectable (UseSelectable, UseSelectableResult, useSelectable)
type State a =
{ selection ∷ Set a