[Ur] Building site templates
James Parker
jp at jamesparker.me
Tue Dec 6 16:33:01 EST 2011
I've tried xml, body, and xhtml. Is there some other type I can try? If I simply define sidebar inside template, the project will compile and run correctly.
The source is available here if it's helpful:
https://github.com/jprider63/UMDTalks
Here's the full error message:
/home/james/Projects/UMDTalks/common.urs:4:32-4:35: Wrong kind
Constructor: Basis.xml
Have kind: {Unit} -> {Type} -> {Type} -> Type
Need kind: Type
Incompatible kinds
Kind 1: {Unit} -> {Type} -> {Type} -> Type
Kind 2: Type
/home/james/Projects/UMDTalks/common.ur:10:0-50:0: Constructor unification failure in signature matching:
Have:
val template :
((Basis.option Basis.string) ->
((Basis.xml ([#Body = ()]) <UNIF:U0::{Type}> <UNIF:U2::{Type}>) ->
<UNIF:F::Type -> Type>
(Basis.xml ([#Html = ()]) <UNIF:U0::{Type}> <UNIF:U2::{Type}>)))
Need:
val template :
((Basis.option Basis.string) ->
(Basis.xml ->
Basis.transaction (Basis.xml ([#Html = ()]) ([]) ([]))))
Con 1:
((Basis.option Basis.string) ->
((Basis.xml ([#Body = ()]) <UNIF:U0::{Type}> <UNIF:U2::{Type}>) ->
<UNIF:F::Type -> Type>
(Basis.xml ([#Html = ()]) <UNIF:U0::{Type}> <UNIF:U2::{Type}>)))
Con 2:
((Basis.option Basis.string) ->
(Basis.xml ->
Basis.transaction (Basis.xml ([#Html = ()]) ([]) ([]))))
Incompatible constructors
Have: Basis.xml ([#Body = ()]) <UNIF:U0::{Type}> <UNIF:U2::{Type}>
Need: Basis.xml
/home/james/Projects/UMDTalks/umdtalks.ur:33:1-34:38: Unification failure
Expression:
fn sidebar : Basis.xml =>
Common.template (Some [Basis.string] "test") sidebar
Have con:
(Basis.xml -> Basis.transaction (Basis.xml ([#Html = ()]) ([]) ([])))
Need con:
((Basis.xml (([#Body = ()]) ++ <UNIF:U10::{Unit}>) <UNIF:U2::{Type}>
([])) -> <UNIF:S::Type -> Type> <UNIF:U::Type>)
Incompatible constructors
Have: Basis.xml
Need:
Basis.xml (([#Body = ()]) ++ <UNIF:U10::{Unit}>) <UNIF:U2::{Type}>
I've been finding it somewhat difficult to understand what the error messages are looking for. Are the type inferencing messages a result of the wrong signature type?
Thanks,
JP
On Dec 6, 2011, at 8:40 AM, Adam Chlipala wrote:
> James Parker wrote:
>> title'<- return (case title of
>> | None => "UMDTalks"
>> | Some t => String.append t " - UMDTalks"
>>
>
> Here I would recommend the infix operator [^] instead of [String.append].
>
>> My current function signature is:
>>
>> val template : option string -> xml -> transaction page
>>
>> I believe the problem is in the signature. I guess what is the proper type for the second parameter?
>>
>
> You probably want [xbody] instead of [xml]. You can look in lib/ur/basis.urs to see the kinds of all the built-in constructors.
>
> _______________________________________________
> Ur mailing list
> Ur at impredicative.com
> http://www.impredicative.com/cgi-bin/mailman/listinfo/ur
More information about the Ur
mailing list