lean4-htt/tests/compiler/foreign/Main/S.lean
Leonardo de Moura c1fccf19cb chore: fix test
2022-01-15 11:46:11 -08:00

11 lines
609 B
Text

constant SPointed : NonemptyType
def S : Type := SPointed.type
instance : Nonempty S := SPointed.property
@[extern "lean_mk_S"] constant mkS (x y : UInt32) (s : @& String) : S
@[extern "lean_S_add_x_y"] constant S.addXY (s : @& S) : UInt32
@[extern "lean_S_string"] constant S.string (s : @& S) : String
-- The following 3 externs have side effects. Thus, we put them in IO.
@[extern "lean_S_global_append"] constant appendToGlobalS (str : @& String) : IO Unit
@[extern "lean_S_global_string"] constant getGlobalString : IO String
@[extern "lean_S_update_global"] constant updateGlobalS (s : @& S) : IO Unit