summaryrefslogtreecommitdiff
path: root/demo/prose
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-10-21 17:44:03 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-10-21 17:44:03 -0400
commit29bfb2f27733a76306314dd4d85d3623d2a56bef (patch)
tree7127f938d372825e6ca6616598dcd18ef3cce4d2 /demo/prose
parentbda701f557d0e9aadd4717dd4fd6a38ac8ceb1eb (diff)
ListShop prose
Diffstat (limited to 'demo/prose')
-rw-r--r--demo/prose8
1 files changed, 7 insertions, 1 deletions
diff --git a/demo/prose b/demo/prose
index a22e1968..8f55f8dc 100644
--- a/demo/prose
+++ b/demo/prose
@@ -50,4 +50,10 @@ form.urp
listShop.urp
-<p>This is my other favorite.</p>
+<p>This example shows off algebraic datatypes, parametric polymorphism, and functors.</p>
+
+<p>The <tt>List</tt> module defines a list datatype, much in the style of SML, but with type parameters written more in Haskell style. The types of <tt>List.length</tt> and <tt>List.rev</tt> indicate that they are polymorphic. Types like <tt>t ::: Type -> ...</tt> indicate polymorphism, with the triple colon denoting that the value of this type parameter should be <i>inferred</i> at uses. A double colon would mean that the type argument must be provided explicitly at uses. In contrast to ML and Haskell, all polymorphism must be <i>declared</i> explicitly in Ur, while instantiations may be inferred at uses.</p>
+
+<p>The <tt>ListFun</tt> module defines a functor for building list editing sub-applications. An argument to the functor <tt>Make</tt> must give the type to be stored in the lists, along with marshaling and unmarshaling functions. In return, the functor returns an entry point function.</p>
+
+<p>The <tt>ListShop</tt> modules ties everything together by instantiating <tt>ListFun.Make</tt> with structures for integers and strings. <tt>show</tt> and <tt>read</tt> can be used for marshaling and unmarshaling in both cases because they are type-class-generic.</p>