> So what does Cayenne do if you don't declare the type for `push'? 
> Does it report an error?
The basic principle in Cayenne is that you need type signatures
everywhere.  This is sometimes rather verbose and is relaxed
in some cases, but not here.  If you omit the type signature
the compiler will complain.

> [... type signatures required for exported procedures...]
> I wasn't aware that this requirement is also essential
> for ensuring the existence of principle types.
I think it depends on how you treat type synonyms.  In Haskell
they are true synonyms, and can always be expanded to a real type,
which would be the principal type.

But I really like type synonyms as abstract types, it's convenient.

> Haskell's module system of course does not allow synonym types to be
> exported as abstract types -- you have to use a newtype instead.
> However, this may be better than Mercury's approach, because abstract
> synonym types become second-class citizens once you add typeclasses,
> since (in both Haskell and Mercury) you're not allowed to have instance
> declarations for synonym types.
Well, Cayenne doesn't have have type classes. :-)

      -- Lennart


Reply via email to