Mercurial > urweb
annotate tests/lessSafeFfi.ur @ 2151:4cd36865e0b5
assert function to use with location literal _LOC_
author | Gabriel Riba Faura <griba2001@gmail.com> |
---|---|
date | Wed, 03 Jun 2015 15:07:46 +0200 |
parents | 3d10ae22abd6 |
children |
rev | line source |
---|---|
adam@2010 | 1 ffi foo : int -> int |
adam@2010 | 2 ffi bar serverOnly benignEffectful : int -> transaction unit |
adam@2010 | 3 ffi baz : transaction int |
adam@2038 | 4 ffi adder : int -> int -> int |
adam@2010 | 5 |
adam@2038 | 6 ffi bup jsFunc "alert" : string -> transaction unit |
adam@2039 | 7 ffi alert : string -> transaction unit |
adam@2010 | 8 |
adam@2010 | 9 fun other () : transaction page = |
adam@2010 | 10 (*bar 17; |
adam@2010 | 11 q <- baz;*) |
adam@2010 | 12 return <xml><body> |
adam@2010 | 13 (*{[foo 42]}, {[q]}*) |
adam@2039 | 14 <button value="bup" onclick={fn _ => bup "asdf"}/> |
adam@2039 | 15 <button value="alert" onclick={fn _ => alert "qqqz"}/> |
adam@2010 | 16 </body></xml> |
adam@2010 | 17 |
adam@2010 | 18 fun main () = return <xml><body> |
adam@2010 | 19 <form> |
adam@2010 | 20 <submit action={other}/> |
adam@2010 | 21 </form> |
adam@2010 | 22 </body></xml> |