io-v2.tri (570B)
1 !import io_v2 as I 2 !import io_v2_storage as Storage 3 !import io_v2_text as Text 4 !export io 5 !export bind 6 !export readBytes 7 !export sha256Hex 8 !export putStr 9 !export abortIO 10 -- Explicit native-v2 package candidate. The published v1 wrapper stays separate. 11 -- Whole-value reads/hashes require a caller-selected budget; no runtime grants. 12 io = I.io 13 bind = I.bind 14 readBytes path limit = Storage.readBytes path limit 15 sha256Hex bytes limit = Storage.hashBytes limit bytes 16 putStr text = I.require I.stdout (writer : I.require (Text.writeText writer text) I.pure) 17 abortIO = I.fail