tricu

An interpreted language for exploring Tree Calculus
Log | Files | Refs | README | LICENSE

objects.tri (543B)


      1 !import io_v2 as IO
      2 !import io_v2_objects as O
      3 !export put
      4 !export get
      5 !export copy
      6 !export putCategory
      7 
      8 put root limit tree = IO.io (O.putTree root limit tree)
      9 get root limit digest = IO.io (O.getTree root limit digest)
     10 copy source destination limit digest = IO.io <| IO.onOk (O.getTree source limit digest)
     11   (tree : O.putTree destination limit tree)
     12 putCategory root limit tree = IO.io <| IO.bind (O.putTree root limit tree) (reply : case reply of
     13   (t, ([category _ _ _], t)) = IO.pure category
     14   _ = IO.fail "Expected operation failure")