<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
There was a problem with your brackets<br>
{t} : works for : val title : xbody = <xml></xml><br>
{[t]} : works for : val title : string = "tofu is good"<br>
<br>
fun head_template (t:string) =<br>
<xml><head><title>{[t]}</title></head></xml><br>
and main () = return <xml><br>
{head_template "Blog Main"}<br>
<body><br>
<br>
</body><br>
</xml><br>
<br>
happy hacking<br>
<br>
<div class="moz-cite-prefix">On 10/02/2014 02:53 PM, Burton Samograd
wrote:<br>
</div>
<blockquote
cite="mid:CAM8pOuNY-yJwpcqLegneWqdbB_RyOs+5rgp-8skF0QZDAGOEvQ@mail.gmail.com"
type="cite">
<div dir="ltr">Hi,<br>
<div class="gmail_quote">
<div dir="ltr">
<div><br>
I'm trying what I think should be a trivial thing but I
can't get this<br>
to compile:<br>
<br>
fun head_template (title:string) = <br>
return
<xml><head><title>{title}</title></head></xml><br>
<br>
and main () = return <xml><br>
{head_template "Blog Main"}<br>
<body><br>
</body><br>
</xml><br>
<br>
I'm trying to create XML templates and return them from
functions to<br>
help break up my pages into managable pieces (common
header, footer,<br>
etc).<br>
<br>
When I compile I get the following mass of errors:<br>
<br>
urweb blog<br>
/home/burton/blog/blog.ur:7:26: (to 7:32) Unification
failure<br>
Expression: title<br>
Have con: string<br>
Need con: <UNIF:U23::Type> ->
<UNIF:U24::Type><br>
Incompatible constructors<br>
Have: string<br>
Need: <UNIF:U23::Type> -> <UNIF:U24::Type><br>
/home/burton/blog/blog.ur:7:30: (to 7:35) Unification
failure<br>
Expression: title<br>
Have con: string<br>
Need con: <br>
xml <UNIF:U6::{Unit}> <UNIF:U8::{Type}>
<UNIF:U10::{Type}><br>
Incompatible constructors<br>
Have: string<br>
Need: xml <UNIF:U6::{Unit}> <UNIF:U8::{Type}>
<UNIF:U10::{Type}><br>
/home/burton/blog/blog.ur:10:5: (to 10:30) Unification
failure<br>
Expression: head_template "Blog Main"<br>
Have con: <br>
<UNIF:D::Type -> Type><br>
(xml ([Html = ()]) (<UNIF:U7::{Type}> ++
<UNIF:U8::{Type}>)<br>
(<UNIF:U9::{Type}> ++ <UNIF:U10::{Type}>))<br>
Need con: <br>
xml <UNIF:U57::{Unit}> <UNIF:U58::{Type}>
<UNIF:U59::{Type}><br>
Kind unification failure<br>
Have: Type -> Type<br>
Need: {Type} -> Type<br>
Incompatible kinds<br>
Kind 1: Type<br>
Kind 2: {Type}<br>
<br>
</div>
I'm using the latest download release available from the
main website.<br>
<br>
<div>--<br>
Burton Samograd<br>
<br>
</div>
</div>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Ur mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Ur@impredicative.com">Ur@impredicative.com</a>
<a class="moz-txt-link-freetext" href="http://www.impredicative.com/cgi-bin/mailman/listinfo/ur">http://www.impredicative.com/cgi-bin/mailman/listinfo/ur</a>
</pre>
</blockquote>
<br>
</body>
</html>