I'm trying to adapt Crud.ur to take a wrapper as a parameter like you
suggested, but I'm having trouble figuring out what the signature of
masterPage is.

Is there a way to get the compiler to print out the signatures similar to
what SML does in interactive mode?

datatype masterPageMode = Normal | NoLeft

fun masterPage pageType header left right footer = 
    case pageType of 
        Normal => return <xml>
          <head>
            <title>CRM Application</title>
          </head>
          <body>
            <div>{header}</div>
            <div>{left}</div>
            <div>{right}</div>
            <div>{footer}</div>
          </body>
        </xml>
        | NoLeft => return <xml>
          <head>
            <title>Login</title>
          </head>
          <body>
            <div>{header}</div>
            <div>{right}</div>
            <div>{footer}</div>
          </body>
         </xml>

On Fri, 11 Dec 2009 21:17:26 -0500, Adam Chlipala <[email protected]>
wrote:
> David Snider wrote:
>> I'm messing around with Ur and I was trying to include one of your
> modules
>> from the tutorials into my application.
>>
>> It seems your module has links that return entirely new pages (starting
>> from body) and I just want it to return fragments so I can have these
>> templated "Master Pages"
>>
>> Any suggestions?
>>
> 
> There is no way to take an arbitrary page-generating function, treated
> as a black box, and build a version that adds additional page content.
> There are many ways of changing the library interface to support more
> uses.  For instance, you can change the library so that the entry point
> function takes as an input a wrapper function to call on the main
content.
> 
> _______________________________________________
> Ur mailing list
> [email protected]
> http://www.impredicative.com/cgi-bin/mailman/listinfo/ur


_______________________________________________
Ur mailing list
[email protected]
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur

Reply via email to