mirror of
https://github.com/Smaug123/agda-utils
synced 2025-10-06 03:58:41 +00:00
Initial commit of the bones of an unused-open-removing Agda tool
This commit is contained in:
23
AgdaUnusedOpens/AgdaCompiler.fs
Normal file
23
AgdaUnusedOpens/AgdaCompiler.fs
Normal 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
|
Reference in New Issue
Block a user