mirror of
https://github.com/Smaug123/agda-utils
synced 2025-10-19 10:08:40 +00:00
Working prototype of unused-reference remover
This commit is contained in:
@@ -7,6 +7,7 @@ open AgdaUnusedOpens.Types
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Path =
|
||||
|
||||
let fold<'s> (f : 's -> string -> 's) (initial : 's) (p : Path) : 's =
|
||||
p.Tail
|
||||
|> List.fold f (f initial p.Head)
|
||||
@@ -68,6 +69,12 @@ module AgdaFile =
|
||||
ModuleLine = moduleLineNo
|
||||
}
|
||||
|
||||
let makeFromFile (f : FileInfo) : AgdaFile =
|
||||
f.FullName
|
||||
|> File.ReadAllLines
|
||||
|> List.ofArray
|
||||
|> make
|
||||
|
||||
let flush (agdaRoot : DirectoryInfo) (f : AgdaFile) : unit =
|
||||
let location = Path.combine agdaRoot f.Path
|
||||
File.WriteAllLines (location.FullName, f.Contents)
|
||||
|
Reference in New Issue
Block a user