From 2e606b03c8dbc594610e62ac260145ac26ebc699 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 23 Oct 2008 12:58:35 -0400 Subject: Fix nasty de Bruijn substitution bug; TcSum demo --- demo/prose | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'demo/prose') diff --git a/demo/prose b/demo/prose index 8fedc557..19e9df0f 100644 --- a/demo/prose +++ b/demo/prose @@ -100,3 +100,7 @@ An unusual part of the third argument is the syntax [t1 ~ t2] within a

The general syntax for constant row types is [Name1 = t1, ..., NameN = tN], and there is a shorthand version [Name1, ..., NameN] for records of Units.

With sum defined, it is easy to make some sample calls. The form of the code for main does not make it apparent, but the compiler must "reverse engineer" the appropriate {Unit} from the {Type} available from the context at each call to sum.

+ +tcSum.urp + +

It's easy to adapt the last example to use type classes, such that we can sum the fields of records based on any numeric type.

-- cgit v1.2.3