summaryrefslogtreecommitdiff
path: root/tests/cffi.ur
blob: 89dc99062718779e8eff0fa276f1ef8723e5492f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
fun printer () = Test.foo

fun effect () =
  Test.print;
  return <xml><body>
    <button value="Remote" onclick={fn _ => rpc (printer ())}/>
    <button value="Local" onclick={fn _ => Test.bar "Hoho"}/>
    <button value="Either" onclick={fn _ => Test.print}/>
  </body></xml>

fun xact () =
  Test.transactional;
  return <xml><body>
    All good.
  </body></xml>

fun xact2 () =
  Test.transactional;
  error <xml>Failure</xml>;
  return <xml><body>
    All gooder.
  </body></xml>

fun main () = return <xml><body>
  {[Test.out (Test.frob (Test.create "Hello ") "world!")]}
  <form><submit action={effect}/></form>
  <form><submit action={xact}/></form>
  <form><submit action={xact2}/></form>
</body></xml>