[jhc] Classes
Samuel Bronson
naesten at gmail.com
Mon Mar 10 20:27:20 EDT 2008
On 3/10/08, John Meacham <john at repetae.net> wrote:
> On Mon, Mar 10, 2008 at 07:52:34PM -0400, Samuel Bronson wrote:
> > > Those are named 'Instance at .Main.Foo.foo.default' and have the type
> > > 'forall a . a -> Int' . A default method
> > > always exists, even if it is just an error saying no default method was
> > > supplied. RULES are generated for the default methods as well in the
> > > same fashion.
> >
> > Well, I meant the additional default methods offered by class
> > aliasses... and what can I do to keep track of what the proper method
> > name is so I can generate the RULES later...
>
> you can use 'FrontEnd.Class.instanceName' and
> 'FrontEnd.Class.defaultInstanceName' for generating appropriate names.
> since class aliases desugar to normal instances, you should not need to
> create any new rules at all.
Eh? Won't that generate the same name as before? Or were you thinking
it would just combine the alias' name with local component of the
method name -- which won't work if the alias expands to classes which
have methods of the same name. Which COULD happen, and should work.
More information about the jhc
mailing list