-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.fs
63 lines (59 loc) · 1.88 KB
/
Program.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
open System
open System.IO
// open Records
open MissingData
// open AE
[<EntryPoint>]
let main argv =
match argv with
| [| sampleFile |] ->
if File.Exists sampleFile then
try
summarize sampleFile
0
with
| :? FormatException as exn ->
printfn $"Error %s{exn.Message}"
1
| :? IOException as exn ->
printfn $"Error %s{exn.Message}"
2
| _ as exn ->
printfn $"Unexpected error occurred: %s{exn.Message}"
3
else
printfn $"File not found: %s{sampleFile}"
4
| _ ->
printfn "You must provide a path to a file"
5
// open Dictionary
//
// [<EntryPoint>]
// let main argv =
// match argv with
// | [| schoolCodesFile; sampleFile |] ->
// if File.Exists sampleFile then
// if File.Exists schoolCodesFile then
// try
// summarize schoolCodesFile sampleFile
// 0
// with
// | :? FormatException as exn ->
// printfn "Error %s" exn.Message
// 1
// | :? IOException as exn ->
// printfn "Error %s" exn.Message
// 2
// | _ as exn ->
// printfn "Unexpected error occurred: %s" exn.Message
// 3
// else
// printfn "File not found: %s" schoolCodesFile
// 5
// else
// printfn "File not found: %s" sampleFile
// 6
// | _ ->
// printfn "You must provide a path to a file"
// 7