Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to use from Typelevel toolkit from REPL #121

Open
armanbilge opened this issue Nov 9, 2023 · 6 comments
Open

Document how to use from Typelevel toolkit from REPL #121

armanbilge opened this issue Nov 9, 2023 · 6 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@armanbilge
Copy link
Member

@armanbilge armanbilge added documentation Improvements or additions to documentation good first issue Good for newcomers labels Nov 9, 2023
@zetashift
Copy link
Contributor

zetashift commented Nov 9, 2023

What is the incantation for this?

❯ scala-cli repl --with-toolkit=typelevel:toolkit
Downloading 3 dependencies and 2 internal dependencies
[error]  Error downloading org.typelevel:toolkit_3:toolkit
[error]   not found: /home/rishi/.ivy2/local/org.typelevel/toolkit_3/toolkit/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/typelevel/toolkit_3/toolkit/toolkit_3-toolkit.pom
[error]   not found: /home/rishi/.cache/scalacli/local-repo/1.0.5/org.typelevel/toolkit_3/toolkit/ivys/ivy.xml
[error]   No fallback URL found
[error] COMMAND_LINE
[error]  Error downloading org.typelevel:toolkit-test_3:toolkit
[error]   not found: /home/rishi/.ivy2/local/org.typelevel/toolkit-test_3/toolkit/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/typelevel/toolkit-test_3/toolkit/toolkit-test_3-toolkit.pom
[error]   not found: /home/rishi/.cache/scalacli/local-repo/1.0.5/org.typelevel/toolkit-test_3/toolkit/ivys/ivy.xml
[error]   No fallback URL found

EDIT: got it!

 scala-cli repl --toolkit=typelevel:latest

@TonioGela
Copy link
Member

WOW! we definitively need that kitchen sink import now :D

@zetashift
Copy link
Contributor

WOW! we definitively need that kitchen sink import now :D

This was exactly my first thought as well!! How cool of a reply experience would that be.

Tho I believe we still need to do unsafeRunSync everywhere no?

@armanbilge
Copy link
Member Author

armanbilge commented Nov 10, 2023

Tho I believe we still need to do unsafeRunSync everywhere no?

Yeah, this is annoying 😒 it's just how it is tho. I guess the REPL-sink import should bring in the implicit runtime that it Just Works:tm:.

@TonioGela
Copy link
Member

TonioGela commented Nov 13, 2023

Tho I believe we still need to do unsafeRunSync everywhere no?

Yeah, this is annoying 😒 it's just how it is tho. I guess the REPL-sink import should bring in the implicit runtime that it Just Works™️.

We can probably namespace the imports then: we can have an import org.typelevel.toolkit.* that is the scripts' kitchen sink import and a import org.typelevel.toolkit.repl.* that extends it with the required implicit (import cats.effect.unsafe.implicits.*).

And now we just need finishing the discussion in #2 :D

[EDIT] There won't be anything preventing the users from importing the repl package in scripts though 🤔 Also, the tooling might get confused.

@zetashift
Copy link
Contributor

It might still be worth it imho, e.g. imagine being able to use it in Markdown: https://scala-cli.virtuslab.org/docs/guides/markdown/

and then you could have some runbook that deploys stuff in the markdown file with docs etc all using IO! Or any other literate programming thingy.
Maybe hook-up a frontend and to it and serve a notebook-type of environment even...
IMHO, it makes a lot of sense to atleast experiment with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
Development

No branches or pull requests

3 participants