-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
16 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,31 @@ | ||
open System | ||
open DataParser.Console.FileRead | ||
open DataParser.Console.FileWrite | ||
open DataParser.Console.DataFiles | ||
open DataParser.Console.Core | ||
|
||
[<Literal>] | ||
let specPath = "./specs" | ||
let specFolderPath = "./specs" | ||
|
||
[<Literal>] | ||
let dataPath = "./data" | ||
let dataFolderPath = "./data" | ||
|
||
[<Literal>] | ||
let outputPath = "./output" | ||
let outputFolderPath = "./output" | ||
|
||
let okHandler = writeOutputFile outputPath | ||
let okHandler = writeOutputFile outputFolderPath | ||
|
||
let errorHandler = List.iter (eprintfn "Error occurred during processing: %+A") | ||
|
||
let program = result { | ||
printfn "Reading spec files..." | ||
let specs = readAllSpecFiles specPath | ||
|
||
printfn "Retrieving data files..." | ||
let dataFiles = getDataFiles dataPath | ||
|
||
printfn "Parsing data files..." | ||
let dataFileParsedResults = Seq.map (mapDataFilePath specs) dataFiles | ||
|
||
printfn "Writing to output..." | ||
Seq.iter (Result.biFoldMap okHandler errorHandler) dataFileParsedResults | ||
|
||
return () | ||
} | ||
|
||
match program with | ||
| Error e -> errorHandler e | ||
| Ok _ -> () | ||
printfn "Reading spec files..." | ||
let specs = readAllSpecFiles specFolderPath | ||
|
||
printfn "Retrieving data files..." | ||
let dataFiles = readDataFiles dataFolderPath | ||
|
||
printfn "Parsing data files..." | ||
let dataFileParsedResults = Seq.map (mapDataFilePath specs) dataFiles | ||
|
||
printfn "Writing to output..." | ||
Seq.iter (Result.biFoldMap okHandler errorHandler) dataFileParsedResults | ||
|
||
printfn "Processing complete. Press Enter to exit." | ||
ignore <| Console.ReadLine() |