Initial commit of the bones of an unused-open-removing Agda tool

This commit is contained in:
Smaug123
2019-12-24 09:35:06 +00:00
commit 421fe4bcb7
23 changed files with 644 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
namespace AgdaUnusedOpens
open System.IO
type AgdaCompiler =
{
Compiler : FileInfo
/// The directory which your Agda modules are defined relative to
AgdaRoot : DirectoryInfo
}
[<RequireQualifiedAccess>]
module AgdaCompiler =
let compiles (config : AgdaCompiler) (f : AgdaFile) : bool =
// Write it out with a different, temporary name, and then run the compiler.
// Delete the temporary file afterwards.
let tempName = failwith ""
let newFile = AgdaFile.rename tempName f
AgdaFile.flush config.AgdaRoot newFile
// run the compiler
(Path.combine config.AgdaRoot newFile.Path).Delete()
true