Mercurial > urweb
comparison demo/prose @ 455:d4a81273d4b1
Nested demo
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 04 Nov 2008 09:33:35 -0500 |
parents | 0ce90d4d9ae7 |
children | ddd363e856ff |
comparison
equal
deleted
inserted
replaced
454:9163f8014f9b | 455:d4a81273d4b1 |
---|---|
51 <p>In the implementation of <tt>Counter.counter</tt>, we see the notation <tt>{[...]}</tt>, which uses type classes to inject values of different types (<tt>int</tt> in this case) into XML. It's probably worth stating explicitly that XML fragments <i>are not strings</i>, so that the type-checker will enforce that our final piece of XML is valid.</p> | 51 <p>In the implementation of <tt>Counter.counter</tt>, we see the notation <tt>{[...]}</tt>, which uses type classes to inject values of different types (<tt>int</tt> in this case) into XML. It's probably worth stating explicitly that XML fragments <i>are not strings</i>, so that the type-checker will enforce that our final piece of XML is valid.</p> |
52 | 52 |
53 form.urp | 53 form.urp |
54 | 54 |
55 <p>Here we see a basic form. The type system tracks which form inputs we include, and it enforces that the form handler function expects a record containing exactly those fields, with exactly the proper types.</p> | 55 <p>Here we see a basic form. The type system tracks which form inputs we include, and it enforces that the form handler function expects a record containing exactly those fields, with exactly the proper types.</p> |
56 | |
57 nested.urp | |
58 | |
59 <p>Here is an implementation of the tiny challenge problem from <a href="http://www.accursoft.co.uk/web/">this web framework comparison</a>. Using nested function definitions, it is easy to persist state across clicks.</p> | |
56 | 60 |
57 listShop.urp | 61 listShop.urp |
58 | 62 |
59 <p>This example shows off algebraic datatypes, parametric polymorphism, and functors.</p> | 63 <p>This example shows off algebraic datatypes, parametric polymorphism, and functors.</p> |
60 | 64 |