Merge pull request #93 from ska80/better-names

Rename some file/dir manipulation functions for consistency
This commit is contained in:
Edwin Brady 2020-05-24 20:16:01 +01:00 committed by GitHub
commit c3d13d0854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 49 additions and 52 deletions

2
.gitignore vendored
View File

@ -25,7 +25,7 @@
/bootstrap/bin/
/bootstrap/lib/
/bootstrap/idris2-0*/
/bootstrap/idris2_app/idris2-boot.*
/bootstrap/idris2_app/idris2-boot*
/bootstrap/idris2_app/libidris2_support.*
/bootstrap/idris2boot
/bootstrap/idris2boot.rkt

View File

@ -23,16 +23,16 @@
(define-libidris2_support fgetc (_fun _pointer -> _int))
(define-libidris2_support idris2_openFile (_fun _string/utf-8 _string/utf-8 _int -> _pointer))
(define-libc fflush (_fun _pointer -> _int))
(define-libidris2_support idris2_fileRemove (_fun _string/utf-8 -> _int))
(define-libidris2_support idris2_removeFile (_fun _string/utf-8 -> _int))
(define-libidris2_support idris2_fileModifiedTime (_fun _pointer -> _int))
(define-libidris2_support idris2_eof (_fun _pointer -> _int))
(define-libidris2_support idris2_closeFile (_fun _pointer -> _void))
(define-libc chmod (_fun _string/utf-8 _int -> _int))
(define-libidris2_support idris2_dirOpen (_fun _string/utf-8 -> _pointer))
(define-libidris2_support idris2_openDir (_fun _string/utf-8 -> _pointer))
(define-libidris2_support idris2_nextDirEntry (_fun _pointer -> _pointer))
(define-libidris2_support idris2_currentDirectory (_fun -> _pointer))
(define-libidris2_support idris2_createDir (_fun _string/utf-8 -> _int))
(define-libidris2_support idris2_dirClose (_fun _pointer -> _void))
(define-libidris2_support idris2_closeDir (_fun _pointer -> _void))
(define-libidris2_support idris2_changeDir (_fun _string/utf-8 -> _int))
(define-libc strlen (_fun _string/utf-8 -> _int))
(define-libc fprintf (_fun _pointer _string/utf-8 _int -> _void))
@ -305,17 +305,17 @@
(define File-System-prim__readChar (lambda (farg-0 farg-1) (fgetc farg-0)))
(define File-System-prim__open (lambda (farg-0 farg-1 farg-2 farg-3) (idris2_openFile farg-0 farg-1 farg-2)))
(define File-System-prim__flush (lambda (farg-0 farg-1) (fflush farg-0)))
(define File-System-prim__fileRemove (lambda (farg-0 farg-1) (idris2_fileRemove farg-0)))
(define File-System-prim__removeFile (lambda (farg-0 farg-1) (idris2_removeFile farg-0)))
(define File-System-prim__fileModifiedTime (lambda (farg-0 farg-1) (idris2_fileModifiedTime farg-0)))
(define File-System-prim__eof (lambda (farg-0 farg-1) (idris2_eof farg-0)))
(define File-System-prim__close (lambda (farg-0 farg-1) (idris2_closeFile farg-0) (vector 0 )))
(define File-System-prim__chmod (lambda (farg-0 farg-1 farg-2) (chmod farg-0 farg-1)))
(define Directory-System-prim_openDir (lambda (farg-0 farg-1) (idris2_dirOpen farg-0)))
(define Directory-System-prim_openDir (lambda (farg-0 farg-1) (idris2_openDir farg-0)))
(define Directory-System-prim_fileErrno (lambda (farg-0) (idris2_fileErrno )))
(define Directory-System-prim_dirEntry (lambda (farg-0 farg-1) (idris2_nextDirEntry farg-0)))
(define Directory-System-prim_currentDir (lambda (farg-0) (idris2_currentDirectory )))
(define Directory-System-prim_createDir (lambda (farg-0 farg-1) (idris2_createDir farg-0)))
(define Directory-System-prim_closeDir (lambda (farg-0 farg-1) (idris2_dirClose farg-0) (vector 0 )))
(define Directory-System-prim_closeDir (lambda (farg-0 farg-1) (idris2_closeDir farg-0) (vector 0 )))
(define Directory-System-prim_changeDir (lambda (farg-0 farg-1) (idris2_changeDir farg-0)))
(define Buffer-Data-stringByteLength (lambda (farg-0) (strlen farg-0)))
(define Buffer-Data-prim__writeBuffer (lambda (farg-0 farg-1 farg-2 farg-3 farg-4) (blodwen-write-bytevec farg-0 farg-1 farg-2 farg-3)))
@ -1073,7 +1073,7 @@
(define File-System-openFile (lambda (arg-0 arg-1 ext-0) (let ((act-15 (File-System-prim__open arg-0 (File-System-modeStr arg-1) 0 ext-0))) ((File-System-case--2185-1751 arg-1 arg-0 act-15 (Prelude-C-47C-61_Eq__Int (PrimIO-prim__nullAnyPtr act-15) (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define File-System-ok (lambda (arg-0 arg-1 ext-0) (Prelude-pure_Applicative__IO 'erased (vector 1 arg-1) ext-0)))
(define File-System-modeStr (lambda (arg-0) (let ((sc0 arg-0)) (case (vector-ref sc0 0) ((0) "r") ((1) "w") ((2) "a") ((3) "r+") ((4) "w+") (else "a+")))))
(define File-System-fileRemove (lambda (arg-0 ext-0) (let ((act-15 (File-System-prim__fileRemove arg-0 ext-0))) ((File-System-case--2535-2080 arg-0 act-15 (Prelude-C-61C-61_Eq__Int act-15 (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define File-System-removeFile (lambda (arg-0 ext-0) (let ((act-15 (File-System-prim__removeFile arg-0 ext-0))) ((File-System-case--2535-2080 arg-0 act-15 (Prelude-C-61C-61_Eq__Int act-15 (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define File-System-fileModifiedTime (lambda (arg-0 ext-0) (let ((act-15 (File-System-prim__fileModifiedTime arg-0 ext-0))) ((File-System-case--2471-2020 arg-0 act-15 (Prelude-C-62_Ord__Int act-15 (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define File-System-fileError (lambda (arg-0 ext-0) (let ((act-15 (File-System-prim_error arg-0 ext-0))) (Prelude-pure_Applicative__IO 'erased (Prelude-C-47C-61_Eq__Int act-15 (Prelude-fromInteger_Num__Int 0)) ext-0))))
(define File-System-fflush (lambda (arg-0 ext-0) (let ((act-15 (File-System-prim__flush arg-0 ext-0))) (Prelude-pure_Applicative__IO 'erased (vector 0 ) ext-0))))
@ -2396,9 +2396,9 @@
(define Directory-System-case--2199-436 (lambda (arg-0 arg-1) (let ((sc0 arg-1)) (cond ((equal? sc0 0) (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 1 )) eta-0))) ((equal? sc0 1) (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 2 )) eta-0))) ((equal? sc0 2) (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 3 )) eta-0))) ((equal? sc0 3) (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 4 )) eta-0))) ((equal? sc0 4) (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 5 )) eta-0)))(else (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 0 (Prelude-C-45_Neg__Int arg-1 5))) eta-0)))))))
(define Directory-System-returnError (lambda (arg-0 ext-0) (let ((act-15 (Directory-System-prim_fileErrno ext-0))) (let ((sc0 act-15)) (cond ((equal? sc0 0) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 1 )) ext-0)) ((equal? sc0 1) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 2 )) ext-0)) ((equal? sc0 2) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 3 )) ext-0)) ((equal? sc0 3) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 4 )) ext-0)) ((equal? sc0 4) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 5 )) ext-0))(else (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 0 (Prelude-C-45_Neg__Int act-15 5))) ext-0)))))))
(define Directory-System-ok (lambda (arg-0 arg-1 ext-0) (Prelude-pure_Applicative__IO 'erased (vector 1 arg-1) ext-0)))
(define Directory-System-dirOpen (lambda (arg-0 ext-0) (let ((act-15 (Directory-System-prim_openDir arg-0 ext-0))) ((Directory-System-case--2387-620 arg-0 act-15 (Prelude-C-47C-61_Eq__Int (PrimIO-prim__nullAnyPtr act-15) (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define Directory-System-openDir (lambda (arg-0 ext-0) (let ((act-15 (Directory-System-prim_openDir arg-0 ext-0))) ((Directory-System-case--2387-620 arg-0 act-15 (Prelude-C-47C-61_Eq__Int (PrimIO-prim__nullAnyPtr act-15) (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define Directory-System-dirEntry (lambda (arg-0 ext-0) (let ((act-15 (Directory-System-prim_dirEntry arg-0 ext-0))) ((Directory-System-case--2425-660 arg-0 act-15 (Prelude-C-47C-61_Eq__Int (PrimIO-prim__nullAnyPtr (PrimIO-prim__forgetPtr 'erased act-15)) (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define Directory-System-dirClose (lambda (arg-0 ext-0) (Directory-System-prim_closeDir arg-0 ext-0)))
(define Directory-System-closeDir (lambda (arg-0 ext-0) (Directory-System-prim_closeDir arg-0 ext-0)))
(define Directory-System-currentDir (lambda (ext-0) (let ((act-15 (Directory-System-prim_currentDir ext-0))) ((Directory-System-case--2355-588 act-15 (Prelude-C-47C-61_Eq__Int (PrimIO-prim__nullAnyPtr (PrimIO-prim__forgetPtr 'erased act-15)) (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define Directory-System-createDir (lambda (arg-0 ext-0) (let ((act-15 (Directory-System-prim_createDir arg-0 ext-0))) ((Directory-System-case--2307-540 arg-0 act-15 (Prelude-C-61C-61_Eq__Int act-15 (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define Directory-System-changeDir (lambda (arg-0 ext-0) (let ((act-15 (Directory-System-prim_changeDir arg-0 ext-0))) (Prelude-pure_Applicative__IO 'erased (Prelude-C-61C-61_Eq__Int act-15 (Prelude-fromInteger_Num__Int 0)) ext-0))))
@ -5599,7 +5599,7 @@
(define Directory-Core-case--10285-4565 (lambda (arg-0 arg-1 arg-2 arg-3) (let ((sc0 arg-3)) (case (vector-ref sc0 0) ((1) (let ((e-2 (vector-ref sc0 1))) (let ((_-0 (vector 1 e-2))) (Directory-Core-case--10311-4578 arg-0 arg-1 arg-2 e-2 _-0 (Directory-Core-findIpkg e-2))))) (else (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 ) eta-0)))))))
(define Directory-Core-case--10233-4513 (lambda (arg-0 arg-1 arg-2) (let ((sc0 arg-2)) (cond ((equal? sc0 0) (Strings-Prelude-C-43C-43 arg-0 (Options-Core-dirSep))) (else (Prelude-strCons (Options-Core-sep) arg-0))))))
(define Directory-Core-case--10208-4479 (lambda (arg-0 arg-1 arg-2) (let ((sc0 arg-2)) (cond ((equal? sc0 0) (vector 1 arg-0)) (else (Directory-Core-findIpkg arg-1))))))
(define Directory-Core-case--10156-4431 (lambda (arg-0 arg-1) (let ((sc0 arg-1)) (case (vector-ref sc0 0) ((1) (let ((e-2 (vector-ref sc0 1))) (lambda (eta-0) (let ((act-15 (Directory-Core-getEntries e-2 eta-0))) (let ((act-16 (Directory-System-dirClose e-2 eta-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 act-15) eta-0)))))) (else (let ((e-5 (vector-ref sc0 1))) (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 e-5) eta-0))))))))
(define Directory-Core-case--10156-4431 (lambda (arg-0 arg-1) (let ((sc0 arg-1)) (case (vector-ref sc0 0) ((1) (let ((e-2 (vector-ref sc0 1))) (lambda (eta-0) (let ((act-15 (Directory-Core-getEntries e-2 eta-0))) (let ((act-16 (Directory-System-closeDir e-2 eta-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 act-15) eta-0)))))) (else (let ((e-5 (vector-ref sc0 1))) (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 e-5) eta-0))))))))
(define Directory-Core-case--10113-4391 (lambda (arg-0 arg-1) (let ((sc0 arg-1)) (case (vector-ref sc0 0) ((1) (let ((e-2 (vector-ref sc0 1))) (lambda (eta-0) (let ((act-15 (Directory-Core-getEntries arg-0 eta-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 e-2 act-15) eta-0))))) (else (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 ) eta-0)))))))
(define Directory-Core-case--10032-4322 (lambda (arg-0 arg-1 arg-2 arg-3) (let ((sc0 arg-3)) (case (vector-ref sc0 0) ((1) (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (Prelude-pure_Applicative__C-40EitherC-32C-36eC-41 'erased 'erased (vector 0 )) eta-0))) (else (let ((e-5 (vector-ref sc0 1))) (lambda (eta-0) (Core-Core-throw_Catchable__Core_Error 'erased (vector 49 (let ((sc1 arg-1)) (let ((e-3 (vector-ref sc1 4))) e-3)) e-5) eta-0))))))))
(define Directory-Core-case--9930-4290 (lambda (arg-0 arg-1 arg-2 arg-3) (let ((sc0 arg-0)) (case (vector-ref sc0 0) ((0) (vector 0 )) (else (let ((e-3 (vector-ref sc0 2))) e-3))))))
@ -5634,7 +5634,7 @@
(define Directory-Core-findIpkgFile (lambda (ext-0) (let ((act-15 (Directory-System-currentDir ext-0))) (let ((sc0 act-15)) (case (vector-ref sc0 0) ((1) (let ((e-1 (vector-ref sc0 1))) (let ((paths (List-Data-reverse 'erased (Directory-Core-allDirs "" (Directory-Core-splitDir e-1))))) (let ((act-16 ((Directory-Core-n--10284-4540-firstIpkg paths) ext-0))) (Prelude-pure_Applicative__IO 'erased act-16 ext-0))))) (else (Prelude-pure_Applicative__IO 'erased (vector 0 ) ext-0)))))))
(define Directory-Core-findIpkg (lambda (arg-0) (let ((sc0 arg-0)) (case (vector-ref sc0 0) ((0) (vector 0 )) (else (let ((e-2 (vector-ref sc0 1))) (let ((e-3 (vector-ref sc0 2))) (Directory-Core-case--10208-4479 e-2 e-3 (Strings-Data-isSuffixOf ".ipkg" e-2)))))))))
(define Directory-Core-dropExtension (lambda (arg-0) (Directory-Core-case--9242-3597 arg-0 (Strings-Data-span (lambda (arg-1) (Prelude-C-47C-61_Eq__Char arg-1 #\.)) (Prelude-reverse arg-0)))))
(define Directory-Core-dirEntries (lambda (arg-0 ext-0) (let ((act-15 (Directory-System-dirOpen arg-0 ext-0))) (let ((sc0 act-15)) (case (vector-ref sc0 0) ((1) (let ((e-2 (vector-ref sc0 1))) (let ((act-16 (Directory-Core-getEntries e-2 ext-0))) (let ((act-17 (Directory-System-dirClose e-2 ext-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 act-16) ext-0))))) (else (let ((e-5 (vector-ref sc0 1))) (Prelude-pure_Applicative__IO 'erased (vector 0 e-5) ext-0))))))))
(define Directory-Core-dirEntries (lambda (arg-0 ext-0) (let ((act-15 (Directory-System-openDir arg-0 ext-0))) (let ((sc0 act-15)) (case (vector-ref sc0 0) ((1) (let ((e-2 (vector-ref sc0 1))) (let ((act-16 (Directory-Core-getEntries e-2 ext-0))) (let ((act-17 (Directory-System-closeDir e-2 ext-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 act-16) ext-0))))) (else (let ((e-5 (vector-ref sc0 1))) (Prelude-pure_Applicative__IO 'erased (vector 0 e-5) ext-0))))))))
(define Directory-Core-allDirs (lambda (arg-0 arg-1) (let ((sc0 arg-1)) (case (vector-ref sc0 0) ((0) (vector 0 )) ((1) (let ((e-8 (vector-ref sc0 1))) (let ((e-9 (vector-ref sc0 2))) (let ((sc1 e-8)) (cond ((equal? sc1 "") (vector 1 (vector 0 (Options-Core-dirSep) e-9) (Directory-Core-allDirs arg-0 e-9)))(else (let ((sc1 arg-0)) (cond ((equal? sc1 "") (let ((sc2 arg-1)) (case (vector-ref sc2 0) ((1) (let ((e-4 (vector-ref sc2 1))) (let ((e-5 (vector-ref sc2 2))) (let ((dC-39 (Directory-Core-case--10233-4513 e-4 e-5 (Options-Core-isWindows)))) (vector 1 (vector 0 dC-39 e-5) (Directory-Core-allDirs dC-39 e-5))))))(else (let ((sc2 arg-1)) (let ((e-1 (vector-ref sc2 1))) (let ((e-2 (vector-ref sc2 2))) (let ((dC-39 (Strings-Prelude-C-43C-43 arg-0 (Prelude-strCons (Options-Core-sep) e-1)))) (vector 1 (vector 0 dC-39 e-2) (Directory-Core-allDirs dC-39 e-2))))))))))(else (let ((sc1 arg-1)) (let ((e-1 (vector-ref sc1 1))) (let ((e-2 (vector-ref sc1 2))) (let ((dC-39 (Strings-Prelude-C-43C-43 arg-0 (Prelude-strCons (Options-Core-sep) e-1)))) (vector 1 (vector 0 dC-39 e-2) (Directory-Core-allDirs dC-39 e-2)))))))))))))))(else (let ((sc0 arg-0)) (cond ((equal? sc0 "") (let ((sc1 arg-1)) (case (vector-ref sc1 0) ((1) (let ((e-4 (vector-ref sc1 1))) (let ((e-5 (vector-ref sc1 2))) (let ((dC-39 (Directory-Core-case--10233-4513 e-4 e-5 (Options-Core-isWindows)))) (vector 1 (vector 0 dC-39 e-5) (Directory-Core-allDirs dC-39 e-5))))))(else (let ((sc1 arg-1)) (let ((e-1 (vector-ref sc1 1))) (let ((e-2 (vector-ref sc1 2))) (let ((dC-39 (Strings-Prelude-C-43C-43 arg-0 (Prelude-strCons (Options-Core-sep) e-1)))) (vector 1 (vector 0 dC-39 e-2) (Directory-Core-allDirs dC-39 e-2))))))))))(else (let ((sc0 arg-1)) (let ((e-1 (vector-ref sc0 1))) (let ((e-2 (vector-ref sc0 2))) (let ((dC-39 (Strings-Prelude-C-43C-43 arg-0 (Prelude-strCons (Options-Core-sep) e-1)))) (vector 1 (vector 0 dC-39 e-2) (Directory-Core-allDirs dC-39 e-2))))))))))))))
(define Version-Idris-with--1916-432 (lambda (arg-0) (let ((sc0 arg-0)) (let ((e-2 (vector-ref sc0 1))) (let ((e-3 (vector-ref sc0 2))) (let ((sc1 e-3)) (cond ((equal? sc1 "") (vector 0 e-2 (vector 0 )))(else (vector 0 e-2 (vector 1 e-3))))))))))
(define Version-Idris-case--1933-502 (lambda (arg-0 arg-1 arg-2 arg-3 arg-4) (let ((sc0 arg-4)) (cond ((equal? sc0 0) (Version-Idris-n--1933-458-showTag arg-0 arg-1 arg-2 arg-3 arg-4)) (else "")))))
@ -7027,7 +7027,7 @@
(define Package-Idris-n--32206-14965-getStr (lambda (arg-0 arg-1 arg-2 arg-3 arg-4) (let ((sc0 arg-4)) (case (vector-ref sc0 0) ((2) (let ((e-0 (vector-ref sc0 1))) (Core-Parser-Text-pure 'erased 'erased ((arg-1 arg-2) e-0))))(else (Core-Parser-Text-fail 'erased 'erased 'erased (Strings-Prelude-C-43C-43 arg-3 " field must be a string")))))))
(define Package-Idris-n--34954-17587-deleteFolder (lambda (arg-0 arg-1 arg-2 arg-3 arg-4 ext-0) (Package-Idris-n--34954-17586-delete arg-0 arg-1 arg-2 (Strings-Prelude-C-43C-43 arg-3 (Strings-Prelude-C-43C-43 (Options-Core-dirSep) (Name-Core-showSep (Options-Core-dirSep) arg-4))) ext-0)))
(define Package-Idris-n--34954-17588-deleteBin (lambda (arg-0 arg-1 arg-2 arg-3 arg-4 arg-5) (let ((ttFile (Strings-Prelude-C-43C-43 arg-3 (Strings-Prelude-C-43C-43 (Options-Core-dirSep) (Strings-Prelude-C-43C-43 (Name-Core-showSep (Options-Core-dirSep) arg-4) (Strings-Prelude-C-43C-43 (Options-Core-dirSep) arg-5)))))) (lambda (eta-0) (let ((act-15 (Package-Idris-n--34954-17586-delete arg-0 arg-1 arg-2 (Strings-Prelude-C-43C-43 ttFile ".ttc") eta-0))) (let ((sc0 act-15)) (case (vector-ref sc0 0) ((0) (let ((e-2 (vector-ref sc0 1))) (Prelude-pure_Applicative__IO 'erased (vector 0 e-2) eta-0))) (else (Package-Idris-n--34954-17586-delete arg-0 arg-1 arg-2 (Strings-Prelude-C-43C-43 ttFile ".ttm") eta-0)))))))))
(define Package-Idris-n--34954-17586-delete (lambda (arg-0 arg-1 arg-2 arg-3 ext-0) (let ((act-15 (let ((act-15 (File-System-fileRemove arg-3 ext-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 act-15) ext-0)))) (let ((sc0 act-15)) (case (vector-ref sc0 0) ((0) (let ((e-2 (vector-ref sc0 1))) (Prelude-pure_Applicative__IO 'erased (vector 0 e-2) ext-0))) (else (let ((e-5 (vector-ref sc0 1))) (let ((sc1 e-5)) (case (vector-ref sc1 0) ((1) (let ((e-2 (vector-ref sc1 1))) (let ((sc2 e-2)) (let ((act-16 (PrimIO-putStrLn (Strings-Prelude-C-43C-43 "Removed: " arg-3) ext-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 act-16) ext-0))))) (else (Prelude-pure_Applicative__IO 'erased (Prelude-pure_Applicative__C-40EitherC-32C-36eC-41 'erased 'erased (vector 0 )) ext-0)))))))))))
(define Package-Idris-n--34954-17586-delete (lambda (arg-0 arg-1 arg-2 arg-3 ext-0) (let ((act-15 (let ((act-15 (File-System-removeFile arg-3 ext-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 act-15) ext-0)))) (let ((sc0 act-15)) (case (vector-ref sc0 0) ((0) (let ((e-2 (vector-ref sc0 1))) (Prelude-pure_Applicative__IO 'erased (vector 0 e-2) ext-0))) (else (let ((e-5 (vector-ref sc0 1))) (let ((sc1 e-5)) (case (vector-ref sc1 0) ((1) (let ((e-2 (vector-ref sc1 1))) (let ((sc2 e-2)) (let ((act-16 (PrimIO-putStrLn (Strings-Prelude-C-43C-43 "Removed: " arg-3) ext-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 act-16) ext-0))))) (else (Prelude-pure_Applicative__IO 'erased (Prelude-pure_Applicative__C-40EitherC-32C-36eC-41 'erased 'erased (vector 0 )) ext-0)))))))))))
(define Package-Idris-neutral_Monoid__C-40C-124UnitC-44MkUnitC-124C-41 (lambda () (vector 0 )))
(define Package-Idris-__Impl_Semigroup_C-40C-124UnitC-44MkUnitC-124C-41 (lambda (ext-0 ext-1) (Package-Idris-C-60C-43C-62_Semigroup__C-40C-124UnitC-44MkUnitC-124C-41 ext-0 ext-1)))
(define Package-Idris-__Impl_Monoid_C-40C-124UnitC-44MkUnitC-124C-41 (lambda () (vector 0 (lambda (arg-2851) (lambda (arg-2852) (Package-Idris-C-60C-43C-62_Semigroup__C-40C-124UnitC-44MkUnitC-124C-41 arg-2851 arg-2852))) (Package-Idris-neutral_Monoid__C-40C-124UnitC-44MkUnitC-124C-41))))

View File

@ -270,17 +270,17 @@
(define File-System-prim__readChar (lambda (farg-0 farg-1) ((foreign-procedure #f "fgetc" (void*) int) farg-0)))
(define File-System-prim__open (lambda (farg-0 farg-1 farg-2 farg-3) ((foreign-procedure #f "idris2_openFile" (string string int) void*) farg-0 farg-1 farg-2)))
(define File-System-prim__flush (lambda (farg-0 farg-1) ((foreign-procedure #f "fflush" (void*) int) farg-0)))
(define File-System-prim__fileRemove (lambda (farg-0 farg-1) ((foreign-procedure #f "idris2_fileRemove" (string) int) farg-0)))
(define File-System-prim__removeFile (lambda (farg-0 farg-1) ((foreign-procedure #f "idris2_removeFile" (string) int) farg-0)))
(define File-System-prim__fileModifiedTime (lambda (farg-0 farg-1) ((foreign-procedure #f "idris2_fileModifiedTime" (void*) int) farg-0)))
(define File-System-prim__eof (lambda (farg-0 farg-1) ((foreign-procedure #f "idris2_eof" (void*) int) farg-0)))
(define File-System-prim__close (lambda (farg-0 farg-1) ((foreign-procedure #f "idris2_closeFile" (void*) void) farg-0) (vector 0 )))
(define File-System-prim__chmod (lambda (farg-0 farg-1 farg-2) ((foreign-procedure #f "chmod" (string int) int) farg-0 farg-1)))
(define Directory-System-prim_openDir (lambda (farg-0 farg-1) ((foreign-procedure #f "idris2_dirOpen" (string) void*) farg-0)))
(define Directory-System-prim_openDir (lambda (farg-0 farg-1) ((foreign-procedure #f "idris2_openDir" (string) void*) farg-0)))
(define Directory-System-prim_fileErrno (lambda (farg-0) ((foreign-procedure #f "idris2_fileErrno" () int) )))
(define Directory-System-prim_dirEntry (lambda (farg-0 farg-1) ((foreign-procedure #f "idris2_nextDirEntry" (void*) void*) farg-0)))
(define Directory-System-prim_currentDir (lambda (farg-0) ((foreign-procedure #f "idris2_currentDirectory" () void*) )))
(define Directory-System-prim_createDir (lambda (farg-0 farg-1) ((foreign-procedure #f "idris2_createDir" (string) int) farg-0)))
(define Directory-System-prim_closeDir (lambda (farg-0 farg-1) ((foreign-procedure #f "idris2_dirClose" (void*) void) farg-0) (vector 0 )))
(define Directory-System-prim_closeDir (lambda (farg-0 farg-1) ((foreign-procedure #f "idris2_closeDir" (void*) void) farg-0) (vector 0 )))
(define Directory-System-prim_changeDir (lambda (farg-0 farg-1) ((foreign-procedure #f "idris2_changeDir" (string) int) farg-0)))
(define Buffer-Data-stringByteLength (lambda (farg-0) ((foreign-procedure #f "strlen" (string) int) farg-0)))
(define Buffer-Data-prim__writeBuffer (lambda (farg-0 farg-1 farg-2 farg-3 farg-4) (blodwen-write-bytevec farg-0 farg-1 farg-2 farg-3)))
@ -1038,7 +1038,7 @@
(define File-System-openFile (lambda (arg-0 arg-1 ext-0) (let ((act-15 (File-System-prim__open arg-0 (File-System-modeStr arg-1) 0 ext-0))) ((File-System-case--2185-1751 arg-1 arg-0 act-15 (Prelude-C-47C-61_Eq__Int (PrimIO-prim__nullAnyPtr act-15) (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define File-System-ok (lambda (arg-0 arg-1 ext-0) (Prelude-pure_Applicative__IO 'erased (vector 1 arg-1) ext-0)))
(define File-System-modeStr (lambda (arg-0) (let ((sc0 arg-0)) (case (vector-ref sc0 0) ((0) "r") ((1) "w") ((2) "a") ((3) "r+") ((4) "w+") (else "a+")))))
(define File-System-fileRemove (lambda (arg-0 ext-0) (let ((act-15 (File-System-prim__fileRemove arg-0 ext-0))) ((File-System-case--2535-2080 arg-0 act-15 (Prelude-C-61C-61_Eq__Int act-15 (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define File-System-removeFile (lambda (arg-0 ext-0) (let ((act-15 (File-System-prim__removeFile arg-0 ext-0))) ((File-System-case--2535-2080 arg-0 act-15 (Prelude-C-61C-61_Eq__Int act-15 (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define File-System-fileModifiedTime (lambda (arg-0 ext-0) (let ((act-15 (File-System-prim__fileModifiedTime arg-0 ext-0))) ((File-System-case--2471-2020 arg-0 act-15 (Prelude-C-62_Ord__Int act-15 (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define File-System-fileError (lambda (arg-0 ext-0) (let ((act-15 (File-System-prim_error arg-0 ext-0))) (Prelude-pure_Applicative__IO 'erased (Prelude-C-47C-61_Eq__Int act-15 (Prelude-fromInteger_Num__Int 0)) ext-0))))
(define File-System-fflush (lambda (arg-0 ext-0) (let ((act-15 (File-System-prim__flush arg-0 ext-0))) (Prelude-pure_Applicative__IO 'erased (vector 0 ) ext-0))))
@ -2361,9 +2361,9 @@
(define Directory-System-case--2199-436 (lambda (arg-0 arg-1) (let ((sc0 arg-1)) (cond ((equal? sc0 0) (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 1 )) eta-0))) ((equal? sc0 1) (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 2 )) eta-0))) ((equal? sc0 2) (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 3 )) eta-0))) ((equal? sc0 3) (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 4 )) eta-0))) ((equal? sc0 4) (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 5 )) eta-0)))(else (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 0 (Prelude-C-45_Neg__Int arg-1 5))) eta-0)))))))
(define Directory-System-returnError (lambda (arg-0 ext-0) (let ((act-15 (Directory-System-prim_fileErrno ext-0))) (let ((sc0 act-15)) (cond ((equal? sc0 0) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 1 )) ext-0)) ((equal? sc0 1) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 2 )) ext-0)) ((equal? sc0 2) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 3 )) ext-0)) ((equal? sc0 3) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 4 )) ext-0)) ((equal? sc0 4) (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 5 )) ext-0))(else (Prelude-pure_Applicative__IO 'erased (vector 0 (vector 0 (Prelude-C-45_Neg__Int act-15 5))) ext-0)))))))
(define Directory-System-ok (lambda (arg-0 arg-1 ext-0) (Prelude-pure_Applicative__IO 'erased (vector 1 arg-1) ext-0)))
(define Directory-System-dirOpen (lambda (arg-0 ext-0) (let ((act-15 (Directory-System-prim_openDir arg-0 ext-0))) ((Directory-System-case--2387-620 arg-0 act-15 (Prelude-C-47C-61_Eq__Int (PrimIO-prim__nullAnyPtr act-15) (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define Directory-System-openDir (lambda (arg-0 ext-0) (let ((act-15 (Directory-System-prim_openDir arg-0 ext-0))) ((Directory-System-case--2387-620 arg-0 act-15 (Prelude-C-47C-61_Eq__Int (PrimIO-prim__nullAnyPtr act-15) (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define Directory-System-dirEntry (lambda (arg-0 ext-0) (let ((act-15 (Directory-System-prim_dirEntry arg-0 ext-0))) ((Directory-System-case--2425-660 arg-0 act-15 (Prelude-C-47C-61_Eq__Int (PrimIO-prim__nullAnyPtr (PrimIO-prim__forgetPtr 'erased act-15)) (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define Directory-System-dirClose (lambda (arg-0 ext-0) (Directory-System-prim_closeDir arg-0 ext-0)))
(define Directory-System-closeDir (lambda (arg-0 ext-0) (Directory-System-prim_closeDir arg-0 ext-0)))
(define Directory-System-currentDir (lambda (ext-0) (let ((act-15 (Directory-System-prim_currentDir ext-0))) ((Directory-System-case--2355-588 act-15 (Prelude-C-47C-61_Eq__Int (PrimIO-prim__nullAnyPtr (PrimIO-prim__forgetPtr 'erased act-15)) (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define Directory-System-createDir (lambda (arg-0 ext-0) (let ((act-15 (Directory-System-prim_createDir arg-0 ext-0))) ((Directory-System-case--2307-540 arg-0 act-15 (Prelude-C-61C-61_Eq__Int act-15 (Prelude-fromInteger_Num__Int 0))) ext-0))))
(define Directory-System-changeDir (lambda (arg-0 ext-0) (let ((act-15 (Directory-System-prim_changeDir arg-0 ext-0))) (Prelude-pure_Applicative__IO 'erased (Prelude-C-61C-61_Eq__Int act-15 (Prelude-fromInteger_Num__Int 0)) ext-0))))
@ -5564,7 +5564,7 @@
(define Directory-Core-case--10285-4565 (lambda (arg-0 arg-1 arg-2 arg-3) (let ((sc0 arg-3)) (case (vector-ref sc0 0) ((1) (let ((e-2 (vector-ref sc0 1))) (let ((_-0 (vector 1 e-2))) (Directory-Core-case--10311-4578 arg-0 arg-1 arg-2 e-2 _-0 (Directory-Core-findIpkg e-2))))) (else (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 ) eta-0)))))))
(define Directory-Core-case--10233-4513 (lambda (arg-0 arg-1 arg-2) (let ((sc0 arg-2)) (cond ((equal? sc0 0) (Strings-Prelude-C-43C-43 arg-0 (Options-Core-dirSep))) (else (Prelude-strCons (Options-Core-sep) arg-0))))))
(define Directory-Core-case--10208-4479 (lambda (arg-0 arg-1 arg-2) (let ((sc0 arg-2)) (cond ((equal? sc0 0) (vector 1 arg-0)) (else (Directory-Core-findIpkg arg-1))))))
(define Directory-Core-case--10156-4431 (lambda (arg-0 arg-1) (let ((sc0 arg-1)) (case (vector-ref sc0 0) ((1) (let ((e-2 (vector-ref sc0 1))) (lambda (eta-0) (let ((act-15 (Directory-Core-getEntries e-2 eta-0))) (let ((act-16 (Directory-System-dirClose e-2 eta-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 act-15) eta-0)))))) (else (let ((e-5 (vector-ref sc0 1))) (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 e-5) eta-0))))))))
(define Directory-Core-case--10156-4431 (lambda (arg-0 arg-1) (let ((sc0 arg-1)) (case (vector-ref sc0 0) ((1) (let ((e-2 (vector-ref sc0 1))) (lambda (eta-0) (let ((act-15 (Directory-Core-getEntries e-2 eta-0))) (let ((act-16 (Directory-System-closeDir e-2 eta-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 act-15) eta-0)))))) (else (let ((e-5 (vector-ref sc0 1))) (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 e-5) eta-0))))))))
(define Directory-Core-case--10113-4391 (lambda (arg-0 arg-1) (let ((sc0 arg-1)) (case (vector-ref sc0 0) ((1) (let ((e-2 (vector-ref sc0 1))) (lambda (eta-0) (let ((act-15 (Directory-Core-getEntries arg-0 eta-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 e-2 act-15) eta-0))))) (else (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (vector 0 ) eta-0)))))))
(define Directory-Core-case--10032-4322 (lambda (arg-0 arg-1 arg-2 arg-3) (let ((sc0 arg-3)) (case (vector-ref sc0 0) ((1) (lambda (eta-0) (Prelude-pure_Applicative__IO 'erased (Prelude-pure_Applicative__C-40EitherC-32C-36eC-41 'erased 'erased (vector 0 )) eta-0))) (else (let ((e-5 (vector-ref sc0 1))) (lambda (eta-0) (Core-Core-throw_Catchable__Core_Error 'erased (vector 49 (let ((sc1 arg-1)) (let ((e-3 (vector-ref sc1 4))) e-3)) e-5) eta-0))))))))
(define Directory-Core-case--9930-4290 (lambda (arg-0 arg-1 arg-2 arg-3) (let ((sc0 arg-0)) (case (vector-ref sc0 0) ((0) (vector 0 )) (else (let ((e-3 (vector-ref sc0 2))) e-3))))))
@ -5599,7 +5599,7 @@
(define Directory-Core-findIpkgFile (lambda (ext-0) (let ((act-15 (Directory-System-currentDir ext-0))) (let ((sc0 act-15)) (case (vector-ref sc0 0) ((1) (let ((e-1 (vector-ref sc0 1))) (let ((paths (List-Data-reverse 'erased (Directory-Core-allDirs "" (Directory-Core-splitDir e-1))))) (let ((act-16 ((Directory-Core-n--10284-4540-firstIpkg paths) ext-0))) (Prelude-pure_Applicative__IO 'erased act-16 ext-0))))) (else (Prelude-pure_Applicative__IO 'erased (vector 0 ) ext-0)))))))
(define Directory-Core-findIpkg (lambda (arg-0) (let ((sc0 arg-0)) (case (vector-ref sc0 0) ((0) (vector 0 )) (else (let ((e-2 (vector-ref sc0 1))) (let ((e-3 (vector-ref sc0 2))) (Directory-Core-case--10208-4479 e-2 e-3 (Strings-Data-isSuffixOf ".ipkg" e-2)))))))))
(define Directory-Core-dropExtension (lambda (arg-0) (Directory-Core-case--9242-3597 arg-0 (Strings-Data-span (lambda (arg-1) (Prelude-C-47C-61_Eq__Char arg-1 #\.)) (Prelude-reverse arg-0)))))
(define Directory-Core-dirEntries (lambda (arg-0 ext-0) (let ((act-15 (Directory-System-dirOpen arg-0 ext-0))) (let ((sc0 act-15)) (case (vector-ref sc0 0) ((1) (let ((e-2 (vector-ref sc0 1))) (let ((act-16 (Directory-Core-getEntries e-2 ext-0))) (let ((act-17 (Directory-System-dirClose e-2 ext-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 act-16) ext-0))))) (else (let ((e-5 (vector-ref sc0 1))) (Prelude-pure_Applicative__IO 'erased (vector 0 e-5) ext-0))))))))
(define Directory-Core-dirEntries (lambda (arg-0 ext-0) (let ((act-15 (Directory-System-openDir arg-0 ext-0))) (let ((sc0 act-15)) (case (vector-ref sc0 0) ((1) (let ((e-2 (vector-ref sc0 1))) (let ((act-16 (Directory-Core-getEntries e-2 ext-0))) (let ((act-17 (Directory-System-closeDir e-2 ext-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 act-16) ext-0))))) (else (let ((e-5 (vector-ref sc0 1))) (Prelude-pure_Applicative__IO 'erased (vector 0 e-5) ext-0))))))))
(define Directory-Core-allDirs (lambda (arg-0 arg-1) (let ((sc0 arg-1)) (case (vector-ref sc0 0) ((0) (vector 0 )) ((1) (let ((e-8 (vector-ref sc0 1))) (let ((e-9 (vector-ref sc0 2))) (let ((sc1 e-8)) (cond ((equal? sc1 "") (vector 1 (vector 0 (Options-Core-dirSep) e-9) (Directory-Core-allDirs arg-0 e-9)))(else (let ((sc1 arg-0)) (cond ((equal? sc1 "") (let ((sc2 arg-1)) (case (vector-ref sc2 0) ((1) (let ((e-4 (vector-ref sc2 1))) (let ((e-5 (vector-ref sc2 2))) (let ((dC-39 (Directory-Core-case--10233-4513 e-4 e-5 (Options-Core-isWindows)))) (vector 1 (vector 0 dC-39 e-5) (Directory-Core-allDirs dC-39 e-5))))))(else (let ((sc2 arg-1)) (let ((e-1 (vector-ref sc2 1))) (let ((e-2 (vector-ref sc2 2))) (let ((dC-39 (Strings-Prelude-C-43C-43 arg-0 (Prelude-strCons (Options-Core-sep) e-1)))) (vector 1 (vector 0 dC-39 e-2) (Directory-Core-allDirs dC-39 e-2))))))))))(else (let ((sc1 arg-1)) (let ((e-1 (vector-ref sc1 1))) (let ((e-2 (vector-ref sc1 2))) (let ((dC-39 (Strings-Prelude-C-43C-43 arg-0 (Prelude-strCons (Options-Core-sep) e-1)))) (vector 1 (vector 0 dC-39 e-2) (Directory-Core-allDirs dC-39 e-2)))))))))))))))(else (let ((sc0 arg-0)) (cond ((equal? sc0 "") (let ((sc1 arg-1)) (case (vector-ref sc1 0) ((1) (let ((e-4 (vector-ref sc1 1))) (let ((e-5 (vector-ref sc1 2))) (let ((dC-39 (Directory-Core-case--10233-4513 e-4 e-5 (Options-Core-isWindows)))) (vector 1 (vector 0 dC-39 e-5) (Directory-Core-allDirs dC-39 e-5))))))(else (let ((sc1 arg-1)) (let ((e-1 (vector-ref sc1 1))) (let ((e-2 (vector-ref sc1 2))) (let ((dC-39 (Strings-Prelude-C-43C-43 arg-0 (Prelude-strCons (Options-Core-sep) e-1)))) (vector 1 (vector 0 dC-39 e-2) (Directory-Core-allDirs dC-39 e-2))))))))))(else (let ((sc0 arg-1)) (let ((e-1 (vector-ref sc0 1))) (let ((e-2 (vector-ref sc0 2))) (let ((dC-39 (Strings-Prelude-C-43C-43 arg-0 (Prelude-strCons (Options-Core-sep) e-1)))) (vector 1 (vector 0 dC-39 e-2) (Directory-Core-allDirs dC-39 e-2))))))))))))))
(define Version-Idris-with--1916-432 (lambda (arg-0) (let ((sc0 arg-0)) (let ((e-2 (vector-ref sc0 1))) (let ((e-3 (vector-ref sc0 2))) (let ((sc1 e-3)) (cond ((equal? sc1 "") (vector 0 e-2 (vector 0 )))(else (vector 0 e-2 (vector 1 e-3))))))))))
(define Version-Idris-case--1933-502 (lambda (arg-0 arg-1 arg-2 arg-3 arg-4) (let ((sc0 arg-4)) (cond ((equal? sc0 0) (Version-Idris-n--1933-458-showTag arg-0 arg-1 arg-2 arg-3 arg-4)) (else "")))))
@ -6992,7 +6992,7 @@
(define Package-Idris-n--32206-14965-getStr (lambda (arg-0 arg-1 arg-2 arg-3 arg-4) (let ((sc0 arg-4)) (case (vector-ref sc0 0) ((2) (let ((e-0 (vector-ref sc0 1))) (Core-Parser-Text-pure 'erased 'erased ((arg-1 arg-2) e-0))))(else (Core-Parser-Text-fail 'erased 'erased 'erased (Strings-Prelude-C-43C-43 arg-3 " field must be a string")))))))
(define Package-Idris-n--34954-17587-deleteFolder (lambda (arg-0 arg-1 arg-2 arg-3 arg-4 ext-0) (Package-Idris-n--34954-17586-delete arg-0 arg-1 arg-2 (Strings-Prelude-C-43C-43 arg-3 (Strings-Prelude-C-43C-43 (Options-Core-dirSep) (Name-Core-showSep (Options-Core-dirSep) arg-4))) ext-0)))
(define Package-Idris-n--34954-17588-deleteBin (lambda (arg-0 arg-1 arg-2 arg-3 arg-4 arg-5) (let ((ttFile (Strings-Prelude-C-43C-43 arg-3 (Strings-Prelude-C-43C-43 (Options-Core-dirSep) (Strings-Prelude-C-43C-43 (Name-Core-showSep (Options-Core-dirSep) arg-4) (Strings-Prelude-C-43C-43 (Options-Core-dirSep) arg-5)))))) (lambda (eta-0) (let ((act-15 (Package-Idris-n--34954-17586-delete arg-0 arg-1 arg-2 (Strings-Prelude-C-43C-43 ttFile ".ttc") eta-0))) (let ((sc0 act-15)) (case (vector-ref sc0 0) ((0) (let ((e-2 (vector-ref sc0 1))) (Prelude-pure_Applicative__IO 'erased (vector 0 e-2) eta-0))) (else (Package-Idris-n--34954-17586-delete arg-0 arg-1 arg-2 (Strings-Prelude-C-43C-43 ttFile ".ttm") eta-0)))))))))
(define Package-Idris-n--34954-17586-delete (lambda (arg-0 arg-1 arg-2 arg-3 ext-0) (let ((act-15 (let ((act-15 (File-System-fileRemove arg-3 ext-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 act-15) ext-0)))) (let ((sc0 act-15)) (case (vector-ref sc0 0) ((0) (let ((e-2 (vector-ref sc0 1))) (Prelude-pure_Applicative__IO 'erased (vector 0 e-2) ext-0))) (else (let ((e-5 (vector-ref sc0 1))) (let ((sc1 e-5)) (case (vector-ref sc1 0) ((1) (let ((e-2 (vector-ref sc1 1))) (let ((sc2 e-2)) (let ((act-16 (PrimIO-putStrLn (Strings-Prelude-C-43C-43 "Removed: " arg-3) ext-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 act-16) ext-0))))) (else (Prelude-pure_Applicative__IO 'erased (Prelude-pure_Applicative__C-40EitherC-32C-36eC-41 'erased 'erased (vector 0 )) ext-0)))))))))))
(define Package-Idris-n--34954-17586-delete (lambda (arg-0 arg-1 arg-2 arg-3 ext-0) (let ((act-15 (let ((act-15 (File-System-removeFile arg-3 ext-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 act-15) ext-0)))) (let ((sc0 act-15)) (case (vector-ref sc0 0) ((0) (let ((e-2 (vector-ref sc0 1))) (Prelude-pure_Applicative__IO 'erased (vector 0 e-2) ext-0))) (else (let ((e-5 (vector-ref sc0 1))) (let ((sc1 e-5)) (case (vector-ref sc1 0) ((1) (let ((e-2 (vector-ref sc1 1))) (let ((sc2 e-2)) (let ((act-16 (PrimIO-putStrLn (Strings-Prelude-C-43C-43 "Removed: " arg-3) ext-0))) (Prelude-pure_Applicative__IO 'erased (vector 1 act-16) ext-0))))) (else (Prelude-pure_Applicative__IO 'erased (Prelude-pure_Applicative__C-40EitherC-32C-36eC-41 'erased 'erased (vector 0 )) ext-0)))))))))))
(define Package-Idris-neutral_Monoid__C-40C-124UnitC-44MkUnitC-124C-41 (lambda () (vector 0 )))
(define Package-Idris-__Impl_Semigroup_C-40C-124UnitC-44MkUnitC-124C-41 (lambda (ext-0 ext-1) (Package-Idris-C-60C-43C-62_Semigroup__C-40C-124UnitC-44MkUnitC-124C-41 ext-0 ext-1)))
(define Package-Idris-__Impl_Monoid_C-40C-124UnitC-44MkUnitC-124C-41 (lambda () (vector 0 (lambda (arg-2851) (lambda (arg-2852) (Package-Idris-C-60C-43C-62_Semigroup__C-40C-124UnitC-44MkUnitC-124C-41 arg-2851 arg-2852))) (Package-Idris-neutral_Monoid__C-40C-124UnitC-44MkUnitC-124C-41))))

View File

@ -35,14 +35,14 @@ prim_changeDir : String -> PrimIO Int
%foreign support "idris2_createDir"
prim_createDir : String -> PrimIO Int
%foreign support "idris2_dirOpen"
%foreign support "idris2_openDir"
prim_openDir : String -> PrimIO DirPtr
%foreign support "idris2_dirClose"
%foreign support "idris2_closeDir"
prim_closeDir : DirPtr -> PrimIO ()
%foreign support "idris2_rmDir"
prim_rmDir : String -> PrimIO ()
%foreign support "idris2_removeDir"
prim_removeDir : String -> PrimIO ()
%foreign support "idris2_nextDirEntry"
prim_dirEntry : DirPtr -> PrimIO (Ptr String)
@ -74,20 +74,20 @@ currentDir
else pure (Just (prim__getString res))
export
dirOpen : String -> IO (Either FileError Directory)
dirOpen d
openDir : String -> IO (Either FileError Directory)
openDir d
= do res <- primIO (prim_openDir d)
if prim__nullAnyPtr res /= 0
then returnError
else ok (MkDir res)
export
dirClose : Directory -> IO ()
dirClose (MkDir d) = primIO (prim_closeDir d)
closeDir : Directory -> IO ()
closeDir (MkDir d) = primIO (prim_closeDir d)
export
rmDir : String -> IO ()
rmDir dirName = primIO (prim_rmDir dirName)
removeDir : String -> IO ()
removeDir dirName = primIO (prim_removeDir dirName)
export
dirEntry : Directory -> IO (Either FileError String)

View File

@ -39,8 +39,8 @@ prim__eof : FilePtr -> PrimIO Int
%foreign "C:fflush,libc 6"
prim__flush : FilePtr -> PrimIO Int
%foreign support "idris2_fileRemove"
prim__fileRemove : String -> PrimIO Int
%foreign support "idris2_removeFile"
prim__removeFile : String -> PrimIO Int
%foreign support "idris2_fileSize"
prim__fileSize : FilePtr -> PrimIO Int
%foreign support "idris2_fileSize"
@ -210,9 +210,9 @@ fileStatusTime (FHandle f)
else returnError
export
fileRemove : String -> IO (Either FileError ())
fileRemove fname
= do res <- primIO (prim__fileRemove fname)
removeFile : String -> IO (Either FileError ())
removeFile fname
= do res <- primIO (prim__removeFile fname)
if res == 0
then ok ()
else returnError
@ -265,7 +265,7 @@ writeFile fn contents = do
closeFile h
pure (Right ())
namespace FileMode
namespace FileMode
public export
data FileMode = Read | Write | Execute

View File

@ -200,10 +200,10 @@ getEntries d
dirEntries : String -> IO (Either FileError (List String))
dirEntries dir
= do Right d <- dirOpen dir
= do Right d <- openDir dir
| Left err => pure (Left err)
ds <- getEntries d
dirClose d
closeDir d
pure (Right ds)
findIpkg : List String -> Maybe String

View File

@ -412,7 +412,7 @@ clean pkg
runScript (postclean pkg)
where
delete : String -> Core ()
delete path = do Right () <- coreLift $ fileRemove path
delete path = do Right () <- coreLift $ removeFile path
| Left err => pure ()
coreLift $ putStrLn $ "Removed: " ++ path

View File

@ -29,7 +29,7 @@ typedef struct {
int error;
} DirInfo;
void* idris2_dirOpen(char* dir) {
void* idris2_openDir(char* dir) {
DIR *d = opendir(dir);
if (d == NULL) {
return NULL;
@ -42,14 +42,14 @@ void* idris2_dirOpen(char* dir) {
}
}
void idris2_dirClose(void* d) {
void idris2_closeDir(void* d) {
DirInfo* di = (DirInfo*)d;
closedir(di->dirptr);
free(di);
}
int idris2_rmDir(char* path) {
int idris2_removeDir(char* path) {
return rmdir(path);
}
@ -64,5 +64,3 @@ char* idris2_nextDirEntry(void* d) {
return de->d_name;
}
}

View File

@ -4,8 +4,9 @@
char* idris2_currentDirectory();
int idris2_changeDir(char* dir);
int idris2_createDir(char* dir);
void* idris2_dirOpen(char* dir);
void idris2_dirClose(void* d);
void* idris2_openDir(char* dir);
void idris2_closeDIr(void* d);
int idris2_removeDir(char* path);
char* idris2_nextDirEntry(void* d);
#endif

View File

@ -44,7 +44,7 @@ int idris2_fileErrno() {
}
}
int idris2_fileRemove(const char *filename) {
int idris2_removeFile(const char *filename) {
return remove(filename);
}
@ -160,5 +160,3 @@ FILE* idris2_stdout() {
FILE* idris2_stderr() {
return stderr;
}

View File

@ -11,7 +11,7 @@ int idris2_fileError(FILE* f);
// Turn errno into an integer understandable by System.File
int idris2_fileErrno();
int idris2_fileRemove(const char *filename);
int idris2_removeFile(const char *filename);
int idris2_fileSize(FILE* h);
int idris2_fpoll(FILE* f);