Skip to content

Instantly share code, notes, and snippets.

View TimWSpence's full-sized avatar

Tim Spence TimWSpence

View GitHub Profile
let Tree
: Type → Type
= λ(Elem : Type) →
∀(T : Type) → ∀(Branch : Elem → T → T → T) → ∀(Leaf : T) → T
let showTree =
λ(elem : Type) →
λ(show : elem → Text) →
λ(tree : Tree elem) →
tree
//> using scala "3.2.1"
//> using lib "org.typelevel::cats-effect-testkit:3.4.0"
//> using lib "org.typelevel::munit-cats-effect-3:1.0.7"
import cats.effect.*
import cats.effect.testkit.TestControl
import munit.CatsEffectSuite
import scala.concurrent.duration.*
class Suite extends CatsEffectSuite:
UnauthorizedAccessException: Access to the path "/private/var/folders/dr/hhydhgf570g59xhljl0l0mkm0000gn/T/AppTranslocation/3231433E-CA2C-435B-BD58-0049DADD6331/d/MapNuke.app/Contents/Export/mapnuke1.map" is denied.
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) (at <319b5411003b47fbaceecace494b6f79>:0)
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize) (at <319b5411003b47fbaceecace494b6f79>:0)
(wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int)
System.IO.File.Create (System.String path, System.Int32 bufferSize) (at <319b5411003b47fbaceecace494b6f79>:0)
System.IO.File.Create (System.String path) (at <319b5411003b47fbaceecace494b6f79>:0)
MapFileWriter.GenerateText (
@TimWSpence
TimWSpence / lift_hang.scala
Created November 17, 2023 11:40
Minimization of hanging caused by canceling a Doobie transaction whilst inside `WeakAsync.liftK`
//> using scala "3.3.1"
//> using dep "org.typelevel::cats-effect::3.5.2"
import cats.*
import cats.syntax.all.*
import cats.effect.*
import cats.effect.std.Dispatcher
import scala.concurrent.duration.*
//> using scala 3
//> using toolkit typelevel:default
import cats.syntax.all.*
import cats.effect.*
import org.http4s.ember.client.EmberClientBuilder
import org.http4s.*
import org.http4s.circe.CirceEntityDecoder.*
import org.http4s.implicits.*
import org.http4s.headers.Authorization