val kind = FormVar.wrapExn (FormVar.getEnumErr ["WhileUsed","TimeOut","Size"]) "kind" handle _ => "Size" fun pp_kind kind = case kind of "Size" => `WhileUsed of size 10000 and without timeout` | _ => `^kind. Entries live in the cache in approximately 20 seconds.

` val _ = Page.return ("Caching Demonstration" ^": cache.sml") (` Cache entries map email addresses to pairs of user ids and names.

Using cache name users and cache kind: ` ^^ (pp_kind kind) ^^ `

The cache has ML type: (string,(int,string)) cache

Lookup EntryFlushAdd Entry
Email

Email
User id
Name
TimeOut

You can choose among the following cache kinds: Size, WhileUsed, TimeOut

Memoization

Calculate fib of .

Using the List type

Using cache name userlist and cache kind: ` ^^ (pp_kind kind) ^^ `

The cache has ML type: (string,string list) cache

Lookup EntryAdd Entry
Email

Email
Firstnames
Lastname

Using the Triple Type Constructor

Using cache name triple and cache kind: ` ^^ (pp_kind kind) ^^ `

The cache has ML type: (string,string,int) cache

Lookup EntryAdd Entry
Email

Email
Firstnames
Lastname
User id

`)