view tests/rpcList2.ur @ 1768:a613cae954ca

Some standard library additions from Edward Z. Yang
author Adam Chlipala <adam@chlipala.net>
date Sat, 19 May 2012 11:32:12 -0400
parents 553a5cc3a4b5
children
line wrap: on
line source
fun showList l = case l of
    [] => "[]"
  | h :: t => strcat (strcat (show h) " :: ") (showList t)

fun rpcFunc l : transaction string =
  case l of h :: _ => return (showList h) | [] => return "[]"

fun main () : transaction page = return <xml><body>
  <button onclick={
    s <- rpc (rpcFunc  (("foo" :: []) :: []));
    alert s
  }/>
  </body></xml>