tricu

A lazy functional language based on Tree Calculus
Log | Files | Refs | README | LICENSE

io.tri (468B)


      1 !import io as I
      2 !import io_storage as Storage
      3 !import io_text as Text
      4 !export io
      5 !export bind
      6 !export readBytes
      7 !export sha256Hex
      8 !export putStr
      9 !export abortIO
     10 -- Packaged IO facade. Reads and hashes take an explicit byte budget.
     11 io = I.io
     12 bind = I.bind
     13 readBytes path limit = Storage.readBytes path limit
     14 sha256Hex bytes limit = Storage.hashBytes limit bytes
     15 putStr text = I.require I.stdout (writer : I.require (Text.writeText writer text) I.pure)
     16 abortIO = I.fail