This file contains hidden or 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
/** This app calculates the number of pizzas needed for each | |
* London Scala event. | |
* | |
* Meat, vegetarian and vegan pizzas are all a Dominos Large | |
* size. Gluten-free pizzas come in a single small size. | |
* | |
* You can run this locally with: | |
* | |
* > scala https://gist.github.com/zainab-ali/231e3ded6e8241d11e3927f9521bc0cc -- <numberOfSignupsOnMeetupDotCom> | |
* |
This file contains hidden or 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.5.0" | |
//> using dep "com.github.zainab-ali::aquascape::0.3.0" | |
import fs2.* | |
import cats.effect.* | |
import aquascape.* | |
import cats.syntax.all.* | |
import scala.concurrent.duration.* | |
object App extends AquascapeApp { |
This file contains hidden or 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 "com.github.zainab-ali::aquascape::0.3.0" | |
import fs2.* | |
import cats.effect.* | |
import aquascape.* | |
import cats.syntax.all.* | |
object App extends AquascapeApp { | |
def name: String = "aquascape" |
This file contains hidden or 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.5.0" | |
//> using dep com.siriusxm::snapshot4s-core::0.1.6 | |
import snapshot4s.Repr | |
class Address() | |
given Repr[Address] = ??? | |
case class Person(name: String, address: Address) | |
val person = Person("Mao", new Address()) |
This file contains hidden or 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 javaOpt -Xmx200m | |
//> using scala "3.4.0" | |
//> using test.dep com.disneystreaming::weaver-cats::0.8.4 | |
package repro | |
import cats.effect.IO | |
import scala.concurrent.duration._ | |
import weaver.SimpleMutableIOSuite | |
object Repro extends SimpleMutableIOSuite { |
This file contains hidden or 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.4.0" | |
//> using lib "com.github.zainab-ali::aquascape:0.1.0" | |
import fs2.* | |
import cats.effect.* | |
import aquascape.* | |
object BasicScape extends AquascapeApp.Simple { | |
def stream(using Scape[IO]) = { | |
Stream(1, 2, 3) | |
.stage("Source") |
This file contains hidden or 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.4.0" | |
//> using lib "co.fs2::fs2-core:3.9.4" | |
import fs2.* | |
import cats.syntax.all.* | |
import cats.effect.* | |
object Demo extends IOApp.Simple { | |
def combineResources[O, O2](f: Chunk[O] => Resource[IO, O2])( | |
in: Stream[IO, Chunk[O]] |
This file contains hidden or 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.4.0" | |
//> using lib "co.fs2::fs2-core:3.9.4" | |
import fs2.* | |
import cats.effect.* | |
import cats.effect.unsafe.implicits.global | |
def infiniteStream: Stream[IO, Unit] = | |
(Stream.unit ++ infiniteStream).pull.echo.stream // vs streamNoScope | |
infiniteStream.compile.drain.unsafeRunSync() |
This file contains hidden or 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.4.0" | |
//> using lib "co.fs2::fs2-core:3.9.4" | |
import fs2.* | |
import cats.effect.* | |
import cats.effect.unsafe.implicits.global | |
def infiniteStream: Stream[IO, Unit] = | |
(Stream.unit ++ infiniteStream) | |
.handleErrorWith(err => Stream.unit) |
This file contains hidden or 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.3.1 | |
//> using dep co.fs2::fs2-core::3.9.4 | |
import cats.syntax.all.* | |
import cats.effect.IO | |
import fs2.Stream | |
import cats.effect.unsafe.implicits.global | |
Stream(1, 2) | |
.covary[IO] |
NewerOlder