Opinionated default implementations of common tasks in scripts.
まだ誰も着手していません。
評価
調査の方向性
この issue ではファイル、テスト、エントリーポイントが指定されていません。まず、toolkit が cats-effect IO と Resource を使った一般的なファイルの読み取りおよび書き込みタスクを対象とすべきかを判断し、その後、関連するライブラリ領域を特定する前に、サポートする操作と完了条件を定義してください。
索引モデルが issue の本文から書いたものです。
説明
Languages like python provide really fast and simple ways to perform most operations, which lends itself very well to scripting.
I think that Scala fails at this, while it's better than Java it's still not great. I don't think this is a problem for most situations.
I do however think it would be very nice if toolkit could provide default implementations of some common tasks in a referential transparent and resource-safe way. An example would be reading and writing files.
I'm pretty new to using CE so I ended up writing this, which I'm not even sure is the correct way to do this.
def fileWriter(path: String): Resource[IO, FileWriter] =
Resource.make(IO.blocking(new FileWriter(new File(name))))(file => IO.blocking(file.close()))
def openFile(path: String) : Resource[IO, Source] =
Resource.make(IO.blocking(Source.fromFile(path)))(file => IO.blocking(file.close()))
def writeToFile(path: String, content: String) =
fileWriter(path).use(writer => IO.blocking(writer.write(content)))
if instead similar operations were already implemented for me I think that would be really great. It would at least make it a lot easier to convince other people to use this :)
All of this might obviously be outside of the scope of toolkit as it's a collection of libraries, but it would certainly make it easier to pick up for people who just want something to write small tools with.
- 主要言語
- Scala
- スター
- 101
- フォーク
- 9
- 平均マージ
- 13分
- マージ済み PR(30日)
- 1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
typelevel/toolkit のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
-
documentation good first issue
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
documentation good first issue help wanted
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
`@IO.main` オープンenhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
typelevel/toolkit の issue をすべて見る
似ている issue
-
Area: Excel support
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
orbeon/orbeon-forms#7893 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
chipsalliance/rocket-chip#3833 ·
-
ShuffleManagerRegistry.register recursion guard is inverted, permits GlutenShuffleManager subclasses オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100