Last active
September 28, 2024 08:58
-
-
Save dacr/37dbfa5a3b519eb2f2eb571a3d2c3c46 to your computer and use it in GitHub Desktop.
hello world with cats-effect / published by https://github.com/dacr/code-examples-manager #ccf93eab-dd65-4711-81ad-69eccccf71b1/c5b3d19128d90bf88197749ae48f08d2b534f09
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
// summary : hello world with cats-effect | |
// keywords : scala, cats, effect, learning, pure-functional, helloworld, @testable | |
// publish : gist | |
// authors : David Crosson | |
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2) | |
// id : ccf93eab-dd65-4711-81ad-69eccccf71b1 | |
// created-on : 2022-01-06T17:55:38+01:00 | |
// managed-by : https://github.com/dacr/code-examples-manager | |
// run-with : scala-cli $file | |
// --------------------- | |
//> using scala "3.5.1" | |
//> using dep "org.typelevel::cats-effect:3.5.4" | |
// --------------------- | |
import cats._ | |
import cats.effect.IO | |
import cats.effect.unsafe.implicits.global | |
val program = for { | |
_ <- IO { println("Hello world") } | |
} yield () | |
program.unsafeRunSync() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment