view tests/lessSafeFfi.ur @ 2086:3d22f761a4b7

In checking signature subsumption, be sure to try constraints last.
author Adam Chlipala <adam@chlipala.net>
date Thu, 04 Dec 2014 20:22:39 -0500
parents 3d10ae22abd6
children
line wrap: on
line source
ffi foo : int -> int
ffi bar serverOnly benignEffectful : int -> transaction unit
ffi baz : transaction int
ffi adder : int -> int -> int

ffi bup jsFunc "alert" : string -> transaction unit
ffi alert : string -> transaction unit

fun other () : transaction page =
    (*bar 17;
    q <- baz;*)
    return <xml><body>
      (*{[foo 42]}, {[q]}*)
      <button value="bup" onclick={fn _ => bup "asdf"}/>
      <button value="alert" onclick={fn _ => alert "qqqz"}/>
    </body></xml>

fun main () = return <xml><body>
  <form>
    <submit action={other}/>
  </form>
</body></xml>