I am a hobby programmer (cook by profession), who is currently trying to teach myself F # and functional programming in general.
In any case, I cheated DeflateStreamand wrote the following two functions:
let Compress compressMe =
let ds = new DeflateStream(File.Create("compressed.txt"), CompressionMode.Compress)
File.OpenRead(compressMe).CopyTo(ds)
ds.Close()
let Decompress =
let ds = new DeflateStream(File.OpenRead("compressed.txt"), CompressionMode.Decompress)
ds.CopyTo(File.Create("decompressed.txt"))
ds.Close()
In the body of the main function, they are called one after another as follows:
Compress args.[0]
Decompress
, .txt Decompress a FileNotFoundException, , , , File.OpenRead("compress.txt"). , Decompress IComparable . , , let Decompress () = [...], IComparable, , . - , F # IComparable , [<EntryPoint>]? , , , .
adavance.