[mercury-users] importing submodules

Michael Day mikeday at yeslogic.com
Mon Dec 2 12:21:33 AEDT 2002


> As an example, we might have a generic back-end module for the compiler
> that took a module argument which would be instantiated with a different
> module for each specific back-end (e.g. back_end(i86) vs back_end(c) vs
> back_end(java) and so forth.)

So this is basically the importer of back_end telling back_end which
module *it* should import?

Is there any advantage over using a back_end(T) type where T must be an
instance of a particular type class? It seems that the module argument
approach would only be superior when there was no module-specific state to
be passed around, which would rarely be the case.

Michael

--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list