Open jaschdoc opened 2 days ago
@mlutze Your comments?
Would it be possible to write a list of effects and functional signatures (including est. size) before starting to program?
I think parallelism is going too far. We also don't really know how it interacts with effects yet.
EDIT: it would be OK if no AE cross thread boundaries.
I think parallelism is going too far. We also don't really know how it interacts with effects yet.
EDIT: it would be OK if no AE cross thread boundaries.
I think it is possible to keep AEs within threads
I think it looks reasonable. Note that Flix already has an argument parsing library that you can use.
I think it looks reasonable. Note that Flix already has an argument parsing library that you can use.
But should he?
I think it looks reasonable. Note that Flix already has an argument parsing library that you can use.
But should he?
Why not? It would be representative of a real program, right?
I think it looks reasonable. Note that Flix already has an argument parsing library that you can use.
Which one?
GetOpt
Maybe something like this?
mod Fget {
type alias Options = { targetFile = String }
pub def getResource(options: Options, url: { url = String }): String \ Http = ???
pub def writeToDisk(options: Options): Unit \ FileWrite = ???
}
Or maybe simpler interface:
mod Fget {
type alias Options = { targetFile = String }
pub def download(options: Options, url: String): String \ FileWrite + Http = ???
def getResource(options: Options, url: { url = String }): String \ Http = ???
def writeToDisk(options: Options): Unit \ FileWrite = ???
}
I think there should be 4 parts of the aplication:
Range
header where it downloads a limited sequence of bytes of the total file so we download a file in parallel. Additionally, if an error occurs (while downloading so we know the resource exists) we can retry the download until it succeeds (with some timeout). This is of course another stretch goal. Lastly, we could also consider supporting recursive downloads to some extent (a stretch goal again).wget [args] url
where one argument we could start with is the output filename.I think the argument parser should be pure but we could experiment with reporting errors via an effect but that seems a little overkill for this project. Similarly, we could also add the failure to download part of a file as an effect and resume again. This would of course be handled by the library so it would not surface to
main
(which should at most use a helper function that eliminates theFileWrite
andHttp
effects so we are left withIO + Net
)