[mercury-users] name clashes in typeclasses
Juergen Stuber
juergen at mpi-sb.mpg.de
Thu Oct 7 04:01:14 AEST 1999
Michael Day <mikeday at corplink.com.au> writes:
>
> Well yes that is what I was referring to with modules, it just feels a
> little odd to make a module called stack and then within that a type class
> called stack also.
I think that is very natural. I'm playing a little with algebra
currently, and there I put each typeclass into its own module,
together with the predicates that work on types in that typeclass.
Each type goes into its own module, with instance declarations for
all the typeclasses it is an instances of. That seems to work
quite well.
Of course this is not a strict rule. If I had very closely
related types or typeclasses it could make sense to put them
together in a module.
> Will all name qualification be done using modules for
> the forseeable future of Mercury? Being unable to overload by type is
> understandable, but by type class hurts a little...
Why don't you just use modules?
Maybe you are still under the influence of some other language?
Cheers
Jürgen
--
Jürgen Stuber <juergen at mpi-sb.mpg.de>
http://www.mpi-sb.mpg.de/~juergen/
--------------------------------------------------------------------------
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