1 import Base 2 3 type Outcome<-Value:Data,-Error:Data> is Data: 4 Saved{value:Value} 5 RefusedPending{} 6 Refused{error:Error} 7 8 # Framework boundary. The ordinary adapter supplies the closed owner inventory, 9 # not deferred history or a caller's estimate of outstanding work. 10 def checked(~Actual:Type,~Value:Data,~Error:Data,~project:Actual -> Actual & Outcome,result:Actual & Bool) -> Actual & Outcome: 11 match result: 12 case (actual,True{}):(actual,RefusedPending{}) 13 case (actual,False{}):project(actual) 14 def save(~Actual:Type,~Value:Data,~Error:Data,~pending:Actual -> Actual & Bool,~project:Actual -> Actual & Outcome,actual:Actual) -> Actual & Outcome: 15 checked(~Actual,~Value,~Error,~project,pending(actual))