[Ur] puzzled about unification error

Marko Schütz Schmuck markoschuetz at googlemail.com
Mon Mar 27 12:31:24 EDT 2017


When I use the "course" example from upo/examples and I use as
function main

val main =
    Theme.tabbed "Course Home Page"
              ((Some "Forum",
                GlobalForum.ui),
               (Some "Users",
                EditUsers.ui))

urweb compiles it. But when I cut it down a little more to

val main =
    Theme.tabbed "Course Home Page"
              ((Some "Users",
                EditUsers.ui))

urweb reports unification failure:

marko at tpad-u:sandbox% urweb course
/home/marko/myStuff/Projects/AssignTAs/sandbox/course.ur:741:14: (to 742:30) Error in final record unification
Can't unify record constructors
Have:
[1 = option string,
  2 =
   {Create : transaction EditUsers.a,
     Onload : EditUsers.a -> transaction {},
     Render :
      Ui.context ->
       EditUsers.a ->
        xml ([Dyn = (), MakeForm = (), Body = ()]) ([]) ([])}]
Need:
map
 (fn a :: Type =>
   (option string) *
                   {Create : transaction a,
                     Onload : a -> transaction {},
                     Render :
                      Ui.context ->
                       a ->
                        xml ([Dyn = (), MakeForm = (), Body = ()])
                         ([]) ([])}) <UNIF:U5433::{Type}>
/home/marko/myStuff/Projects/AssignTAs/sandbox/course.ur:741:14: (to 742:30) Stuck unifying these records after canceling matching pieces:
Have:
[1 = option string,
  2 =
   {Create : transaction EditUsers.a,
     Onload : EditUsers.a -> transaction unit,
     Render : Ui.context -> EditUsers.a -> xbody}]
Need:
map (fn a :: Type => (option string) * (Ui.t a)) <UNIF:U5433::{Type}>

Currently, I have only a vague idea what's going on. I'd appreciate an
explanation and what is the recommended way to fix this?

Best regards,

Marko
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP Digital Signature
URL: <http://www.impredicative.com/pipermail/ur/attachments/20170327/6902eedb/attachment.sig>


More information about the Ur mailing list