From 011a2d458a677c5db5c2fdf0684eeecaf688d6d9 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 3 May 2009 16:00:43 -0400 Subject: crud3 demo --- demo/prose | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'demo/prose') diff --git a/demo/prose b/demo/prose index a5935bb9..0c443692 100644 --- a/demo/prose +++ b/demo/prose @@ -231,6 +231,12 @@ crud2.urp

This example shows another application of Crud.Make. We mix one standard column with one customized column. We write an underscore for the Inject field of meta-data, since the type class facility can infer that witness.

+crud3.urp + +

One thing that is unclear from the previous examples is how to provide more complex, multi-input widgets for taking input meant for particular fields. The signature of Crud.Make forces every widget to define exactly one input. The <subform> tag, the simpler cousin of the <subforms> tag that we saw earlier, provides a fix for this problem. Via <subform>, an arbitrary form can be turned into a single record-valued input.

+ +

We use that possibility here to define a silly widget for a string column, which concatenates the values entered into two different textboxes.

+ alert.urp

Ur/Web makes it easy to write code whose execution should be distributed between the web server and client web browsers. Server-side code is compiled to efficient native code, and client-side code is compiled to JavaScript. Ur/Web programmers don't need to worry about these details, because the language and standard library provide a uniform ML-like interface for the whole process.

-- cgit v1.2.3