On Mon, Apr 16, 2012 at 12:18 PM, Sandro Magi <[email protected]>wrote:

> The reason type classes are so attractive is twofold:
>
>  1. Implicit instantiation.
>  2. Sets of overloaded methods whose invariants must be coherent are
> grouped together.
>

Your second point reminds me of something that used to bug me about the
scope of FORALL qualifiers.

When doing something like a collection, you write a bunch of functions,
each parametric. Each of those type variables ends up in a FORALL qualifier
whose scope is the definition or declaration.

But you frequently find that there are a *bunch* of procedures that all go
together. In effect, these are defining a family of operations on some
type. From the *human* perspective, it sometimes feels like we ought to be
able to state a FORALL qualifier over a *set* of definitions.

We get the right result without any multi-definition FORALLs; it's just
sugar. It just struck me as a place where the scoping didn't quite
correspond to the thing I was trying to "say" (in the sense of
documentation) with the code.

shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to