-
Notifications
You must be signed in to change notification settings - Fork 521
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2993 from TimWSpence/docs-faq
Add a FAQ section to the docs
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
id: faq | ||
title: FAQ | ||
--- | ||
|
||
## Scala CLI | ||
|
||
[Scala CLI](https://scala-cli.virtuslab.org/) can run both `.sc` files and `.scala` files. `.sc` files allow definitions at the top level and a main method is synthesized to run it. Unfortunately this does not work well with `IO#unsafeRunSync`. You should put your cats-effect code inside the `run` method of an `IOApp` and save it as a `.scala` file instead. | ||
|
||
```scala-cli | ||
//> using scala "2.13.8" | ||
//> using lib "org.typelevel::cats-effect::3.3.11" | ||
import cats.effect._ | ||
object HelloWorld extends IOApp.Simple { | ||
val run: IO[Unit] = IO.println("Hello world") | ||
} | ||
``` | ||
|
||
```sh | ||
scala-cli Hello.scala | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
"getting-started", | ||
"concepts", | ||
"tutorial", | ||
"faq", | ||
"migration-guide" | ||
], | ||
"Core Runtime": [ | ||
|