Documentation

Init.System.IO

noncomputable def IO.RealWorld :
Type
Equations
noncomputable def EIO (ε : Type) :
TypeType
Equations
instance instMonadEIO {ε : Type} :
Monad (EIO ε)
Equations
instance instMonadFinallyEIO {ε : Type} :
Equations
instance instMonadExceptOfEIO {ε : Type} :
Equations
instance instOrElseEIO {ε : Type} {α : Type} :
OrElse (EIO ε α)
Equations
  • instOrElseEIO = { orElse := MonadExcept.orElse }
instance instInhabitedEIO {ε : Type} {α : Type} [inst : Inhabited ε] :
Inhabited (EIO ε α)
Equations
noncomputable def BaseIO :
TypeType
Equations
@[inline]
def BaseIO.toEIO {α : Type} {ε : Type} (act : BaseIO α) :
EIO ε α
Equations
instance instMonadLiftBaseIOEIO {ε : Type} :
Equations
  • instMonadLiftBaseIOEIO = { monadLift := fun {α} => BaseIO.toEIO }
@[inline]
def EIO.toBaseIO {ε : Type} {α : Type} (act : EIO ε α) :
BaseIO (Except ε α)
Equations
@[inline]
def EIO.catchExceptions {ε : Type} {α : Type} (act : EIO ε α) (h : εBaseIO α) :
Equations
@[inline]
abbrev IO :
TypeType
Equations
@[inline]
def BaseIO.toIO {α : Type} (act : BaseIO α) :
IO α
Equations
@[inline]
def EIO.toIO {ε : Type} {α : Type} (f : εIO.Error) (act : EIO ε α) :
IO α
Equations
@[inline]
def EIO.toIO' {ε : Type} {α : Type} (act : EIO ε α) :
IO (Except ε α)
Equations
@[inline]
def IO.toEIO {ε : Type} {α : Type} (f : IO.Errorε) (act : IO α) :
EIO ε α
Equations
@[inline]
unsafe def unsafeBaseIO {α : Type} (fn : BaseIO α) :
α
Equations
@[inline]
unsafe def unsafeEIO {ε : Type} {α : Type} (fn : EIO ε α) :
Except ε α
Equations
@[inline]
unsafe def unsafeIO {α : Type} (fn : IO α) :
Equations
@[extern lean_io_timeit]
constant timeit {α : Type} (msg : String) (fn : IO α) :
IO α
@[extern lean_io_allocprof]
constant allocprof {α : Type} (msg : String) (fn : IO α) :
IO α
@[extern lean_io_initializing]
@[extern lean_io_as_task]
constant BaseIO.asTask {α : Type} (act : BaseIO α) (prio : optParam Task.Priority Task.Priority.default) :
@[extern lean_io_map_task]
constant BaseIO.mapTask {α : Type u_1} {β : Type} (f : αBaseIO β) (t : Task α) (prio : optParam Task.Priority Task.Priority.default) :
@[extern lean_io_bind_task]
constant BaseIO.bindTask {α : Type u_1} {β : Type} (t : Task α) (f : αBaseIO (Task β)) (prio : optParam Task.Priority Task.Priority.default) :
def BaseIO.mapTasks {α : Type u_1} {β : Type} (f : List αBaseIO β) (tasks : List (Task α)) (prio : optParam Task.Priority Task.Priority.default) :
Equations
def BaseIO.mapTasks.go {α : Type u_1} {β : Type} (f : List αBaseIO β) (prio : optParam Task.Priority Task.Priority.default) :
List (Task α)List αBaseIO (Task β)
Equations
@[inline]
def EIO.asTask {ε : Type} {α : Type} (act : EIO ε α) (prio : optParam Task.Priority Task.Priority.default) :
BaseIO (Task (Except ε α))
Equations
@[inline]
def EIO.mapTask {α : Type u_1} {ε : Type} {β : Type} (f : αEIO ε β) (t : Task α) (prio : optParam Task.Priority Task.Priority.default) :
BaseIO (Task (Except ε β))
Equations
@[inline]
def EIO.bindTask {α : Type u_1} {ε : Type} {β : Type} (t : Task α) (f : αEIO ε (Task (Except ε β))) (prio : optParam Task.Priority Task.Priority.default) :
BaseIO (Task (Except ε β))
Equations
@[inline]
def EIO.mapTasks {α : Type u_1} {ε : Type} {β : Type} (f : List αEIO ε β) (tasks : List (Task α)) (prio : optParam Task.Priority Task.Priority.default) :
BaseIO (Task (Except ε β))
Equations
def IO.ofExcept {ε : Type u_1} {α : Type} [inst : ToString ε] (e : Except ε α) :
IO α
Equations
def IO.lazyPure {α : Type} (fn : Unitα) :
IO α
Equations
@[extern lean_io_mono_ms_now]
constant IO.monoMsNow :
@[extern lean_io_get_random_bytes]
constant IO.getRandomBytes (nBytes : USize) :
def IO.sleep (ms : UInt32) :
Equations
@[inline]
def IO.asTask {α : Type} (act : IO α) (prio : optParam Task.Priority Task.Priority.default) :
Equations
@[inline]
def IO.mapTask {α : Type u_1} {β : Type} (f : αIO β) (t : Task α) (prio : optParam Task.Priority Task.Priority.default) :
Equations
@[inline]
def IO.bindTask {α : Type u_1} {β : Type} (t : Task α) (f : αIO (Task (Except IO.Error β))) (prio : optParam Task.Priority Task.Priority.default) :
Equations
@[inline]
def IO.mapTasks {α : Type u_1} {β : Type} (f : List αIO β) (tasks : List (Task α)) (prio : optParam Task.Priority Task.Priority.default) :
Equations
@[extern lean_io_check_canceled]
@[extern lean_io_cancel]
constant IO.cancel {α : Type u_1} :
@[extern lean_io_has_finished]
constant IO.hasFinished {α : Type u_1} :
@[extern lean_io_wait]
constant IO.wait {α : Type} (t : Task α) :
@[extern lean_io_wait_any]
constant IO.waitAny {α : Type} :
List (Task α)IO α
@[extern lean_io_get_num_heartbeats]
inductive IO.FS.Mode :
Type
constant IO.FS.Handle :
Type
structure IO.FS.Stream :
Type
Equations
  • IO.FS.instInhabitedStream = { default := { isEof := default, flush := default, read := default, write := default, getLine := default, putStr := default } }
@[extern lean_get_stdin]
@[extern lean_get_stdout]
@[extern lean_get_stderr]
@[extern lean_get_set_stdin]
@[extern lean_get_set_stdout]
@[extern lean_get_set_stderr]
@[specialize]
partial def IO.iterate {α : Type} {β : Type} (a : α) (f : αIO (α β)) :
IO β
@[extern lean_io_prim_handle_mk]
@[extern lean_io_prim_handle_is_eof]
@[extern lean_io_prim_handle_flush]
@[extern lean_io_prim_handle_read]
constant IO.FS.Handle.read (h : IO.FS.Handle) (bytes : USize) :
@[extern lean_io_prim_handle_write]
constant IO.FS.Handle.write (h : IO.FS.Handle) (buffer : ByteArray) :
@[extern lean_io_prim_handle_get_line]
@[extern lean_io_prim_handle_put_str]
@[extern lean_io_realpath]
@[extern lean_io_remove_file]
constant IO.FS.removeFile (fname : System.FilePath) :
@[extern lean_io_remove_dir]
@[extern lean_io_create_dir]
@[extern lean_io_getenv]
constant IO.getEnv (var : String) :
@[extern lean_io_app_path]
@[extern lean_io_current_dir]
@[inline]
def IO.FS.withFile {α : Type} (fn : System.FilePath) (mode : IO.FS.Mode) (f : IO.FS.HandleIO α) :
IO α
Equations
Equations
partial def IO.FS.lines.read (h : IO.FS.Handle) (lines : Array String) :
def IO.FS.writeBinFile (fname : System.FilePath) (content : ByteArray) :
Equations
def IO.FS.writeFile (fname : System.FilePath) (content : String) :
Equations
structure IO.FS.DirEntry :
Type
Equations
inductive IO.FS.FileType :
Type
structure IO.FS.SystemTime :
Type
Equations
structure IO.FS.Metadata :
Type
@[extern lean_io_read_dir]
@[extern lean_io_metadata]
Equations
def IO.withStdin {m : TypeType u_1} {α : Type} [inst : Monad m] [inst : MonadFinally m] [inst : MonadLiftT BaseIO m] (h : IO.FS.Stream) (x : m α) :
m α
Equations
def IO.withStdout {m : TypeType u_1} {α : Type} [inst : Monad m] [inst : MonadFinally m] [inst : MonadLiftT BaseIO m] (h : IO.FS.Stream) (x : m α) :
m α
Equations
def IO.withStderr {m : TypeType u_1} {α : Type} [inst : Monad m] [inst : MonadFinally m] [inst : MonadLiftT BaseIO m] (h : IO.FS.Stream) (x : m α) :
m α
Equations
def IO.print {α : Type u_1} [inst : ToString α] (s : α) :
Equations
def IO.println {α : Type u_1} [inst : ToString α] (s : α) :
Equations
def IO.eprint {α : Type u_1} [inst : ToString α] (s : α) :
Equations
def IO.eprintln {α : Type u_1} [inst : ToString α] (s : α) :
Equations
Equations
structure IO.Process.Child (cfg : IO.Process.StdioConfig) :
Type
@[extern lean_io_process_spawn]
constant IO.Process.spawn (args : IO.Process.SpawnArgs) :
IO (IO.Process.Child args.toStdioConfig)
@[extern lean_io_process_child_wait]
@[extern lean_io_process_child_take_stdin]
constant IO.Process.Child.takeStdin {cfg : IO.Process.StdioConfig} :
IO.Process.Child cfgIO (IO.Process.Stdio.toHandleType cfg.stdin × IO.Process.Child { stdin := IO.Process.Stdio.null, stdout := cfg.stdout, stderr := cfg.stderr })
structure IO.Process.Output :
Type
Equations
Equations
@[extern lean_io_exit]
constant IO.Process.exit {α : Type} :
UInt8IO α
structure IO.AccessRight :
Type
Equations
structure IO.FileRight :
Type
Equations
@[extern lean_chmod]
constant IO.Prim.setAccessRights (filename : System.FilePath) (mode : UInt32) :
Equations
@[inline]
abbrev IO.Ref (α : Type) :
Type
Equations
def IO.mkRef {α : Type} (a : α) :
Equations
structure IO.FS.Stream.Buffer :
Type
Equations
def IO.FS.withIsolatedStreams {m : TypeType u_1} {α : Type} [inst : Monad m] [inst : MonadFinally m] [inst : MonadLiftT BaseIO m] (x : m α) :
m (String × α)
Equations
class Lean.Eval (α : Type u) :
Type u
Instances
instance Lean.instEval {α : Type u_1} [inst : ToString α] :
Equations
instance Lean.instEval_1 {α : Type u_1} [inst : Repr α] :
Equations
Equations
instance Lean.instEvalIO {α : Type} [inst : Lean.Eval α] :
Equations
@[noinline, nospecialize]
def Lean.runEval {α : Type u_1} [inst : Lean.Eval α] (a : Unitα) :
Equations