view demo/cookie.ur @ 921:ae0110465421

Don't replace <sc> in blob returns; optimize more 'option' pattern matches; detect more opportunities for 'let' inlining
author Adam Chlipala <adamc@hcoop.net>
date Wed, 09 Sep 2009 08:00:45 -0400
parents ddd363e856ff
children 93315ac00394
line wrap: on
line source
cookie c : {A : string, B : float, C : int}

fun set r =
    setCookie c {A = r.A, B = readError r.B, C = readError r.C};
    return <xml>Cookie set.</xml>

fun main () =
    ro <- getCookie c;
    return <xml><body>
      {case ro of
           None => <xml>No cookie set.</xml>
         | Some v => <xml>Cookie: A = {[v.A]}, B = {[v.B]}, C = {[v.C]}</xml>}
      <br/><br/>

      <form>
        A: <textbox{#A}/><br/>
        B: <textbox{#B}/><br/>
        C: <textbox{#C}/><br/>
        <submit action={set}/>
      </form>
    </body></xml>