<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">As you mentioned in your other email, "return ()" is a no-op.<div><br></div><div>Right now I think your code won't do quite what you want. It currently builds a transaction that will set at most one source, whereas I think you're trying to set all of them. This is because you're dropping the "acc" argument in the function. Changing the function to</div><div><br></div><div>  (fn [nm :: Name] [t ::_] [rest ::_] [[nm] ~ rest] t s acc =><br>    acc; set s t.Default</div><div>  )<br></div><div><br></div><div>should fix that. Even better, use Monad.appR2 (see lib/ur/monad.urs in the Ur/Web directory), which is a specialized version of foldR2.</div><div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 23, 2020 at 3:35 AM Urs Wegmann <<a href="mailto:urs@wegmann-informatik.ch" target="_blank">urs@wegmann-informatik.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Is there a way to create a transaction that does nothing? Something like:<br>
val noop : unit -> transaction unit<br>
<br>
The closest thing of this I'm aware of is:<br>
val debug : string -> transaction unit<br>
<br>
My use case is:<br>
@foldR2<br>
  [colInfo]<br>
  [source]<br>
  [fn _ => transaction unit]<br>
  (fn [nm :: Name] [t ::_] [rest ::_] [[nm] ~ rest] t s acc =><br>
    set s t.Default<br>
  )<br>
  (debug "reset sources")<br>
  M.fl<br>
  M.t<br>
  sources<br>
<br>
I'm quite new to Ur, so maybe there is a better way to achieve the same.<br>
<br>
<br>
<br>
_______________________________________________<br>
Ur mailing list<br>
<a href="mailto:Ur@impredicative.com" target="_blank">Ur@impredicative.com</a><br>
<a href="http://www.impredicative.com/cgi-bin/mailman/listinfo/ur" rel="noreferrer" target="_blank">http://www.impredicative.com/cgi-bin/mailman/listinfo/ur</a><br>
</blockquote></div>