Opinionated default implementations of common tasks in scripts.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Issue không nêu tệp, bài kiểm thử hay entry point nào. Trước tiên, hãy xác định liệu toolkit có nên hỗ trợ các tác vụ đọc và ghi tệp phổ biến bằng cats-effect IO và Resource hay không, sau đó xác định các thao tác được hỗ trợ và tiêu chí hoàn thành trước khi tìm khu vực thư viện liên quan.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Scala
- Star
- 101
- Fork
- 9
- Merge trung bình
- 13 phút
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của typelevel/toolkit
-
To-do list for 1.0 release? Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
-
SLF4J Logging Warnings Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
-
documentation good first issue
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
documentation good first issue help wanted
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
`@IO.main` Đang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Tất cả issue của typelevel/toolkit
Issue tương tự
-
Area: Excel support
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
orbeon/orbeon-forms#7893 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
lichess-org/lila#21788 · 2 bình luận ·
-
area:Iceberg area:writer documentation requires-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/datafusion-comet#6147 ·
-
feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
GiganticMinecraft/SeichiAssist#2978 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
chipsalliance/rocket-chip#3833 ·