<div dir="ltr"><div><div><div>Still no luck:<br><br>fun head_template (_title:string) = <br>    return <xml><head><title>{[_title]}</title></head></xml><br><br>fun main () = return <xml><br>    {head_template "Blog Main"}<br>    <body><br>    </body><br>    </xml><br><br><br></div>Compiling gives:<br><br>/home/burton/blog/blog.ur:7:5: (to 7:30) Unification failure<br>Expression:  head_template "Blog Main"<br>  Have con: <br><UNIF:B::Type -> Type> (xml ([Html = ()]) <UNIF:I::{Type}> ([]))<br>  Need con: <br>xml <UNIF:U62::{Unit}> <UNIF:U63::{Type}> <UNIF:U64::{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>--<br></div>Burton Samograd<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 2, 2014 at 1:03 PM, <a href="mailto:maasha@gmail.com">maasha@gmail.com</a> <span dir="ltr"><<a href="mailto:maasha@gmail.com" target="_blank">maasha@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div 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><span class=""><br>
    and main () = return <xml><br>
        {head_template "Blog Main"}<br>
        <body><br>
    <br>
        </body><br>
        </xml><br>
    <br></span>
    happy hacking<div><div class="h5"><br>
    <br>
    <div>On 10/02/2014 02:53 PM, Burton Samograd
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      <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></fieldset>
      <br>
      </div></div><pre>_______________________________________________
Ur mailing list
<a href="mailto:Ur@impredicative.com" target="_blank">Ur@impredicative.com</a>
<a href="http://www.impredicative.com/cgi-bin/mailman/listinfo/ur" target="_blank">http://www.impredicative.com/cgi-bin/mailman/listinfo/ur</a>
</pre>
    </blockquote>
    <br>
  </div>

<br>_______________________________________________<br>
Ur mailing list<br>
<a href="mailto:Ur@impredicative.com">Ur@impredicative.com</a><br>
<a href="http://www.impredicative.com/cgi-bin/mailman/listinfo/ur" target="_blank">http://www.impredicative.com/cgi-bin/mailman/listinfo/ur</a><br>
<br></blockquote></div><br></div>