[Ur] common type for different functor instantiations

Gergely Buday gbuday at gmail.com
Wed Oct 26 11:21:03 EDT 2011


Hi,

I have the following problem:

record ::: {Type} is fixed, [data] is dependent on [record] and
[MspecificFields]

I have a functor, that, among others, contain

functor Render (M: sig
                               con MspecificFields :: {Type}
                               val renderMspecific : $MspecificFields -> xbody
                             end )
: sig
    render : data -> xbody
  end

I call this for three different M, but now I want to rewrite it so
that the resulting module has the signature

sig
  type mRecord
  getRecord : data ->  mRecord
  render :  mRecord -> mRecord -> xbody
end

so that the caller can store the previous value of mRecord and the
render function can compare the fresh and the stored. Since the
argument structures differ in some fields, I cannot declare a common
type for mRecord, or, at least, I do not see how I could.

Is there a solution for this in ur/web?

- Gergely



More information about the Ur mailing list