Last active
June 24, 2023 08:46
-
-
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/e7a451f5c8f86b131666c1a061b8bb9bcc4ef60c
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
// 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.3.0" | |
//> using dep "org.typelevel::cats-effect:3.5.0" | |
// --------------------- | |
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