Koen Claessen wrote:
> We should allow "partial type specification". The programmer
> is allowed to specify as much information about the type as
> (s)he wants.
>
> The partial type specification would be taken as a "skeleton",
> merely filled in by the type inference algorithm.
>
> Here is how we could specify partial type information
> about foo:
>
>   foo :: (..) => a -> b -> c
>
> Or even:
>
>   foo :: (Giggle a, ..) => a -> b -> c
>   foo :: (Giggle a, Goggle b, ..) => a -> b -> c
>
> (
> Or we could maybe even use (..) at the *type* level:
>
>   foo :: (..) => a -> (..) -> (..)
>   foo :: (..) => (..)
> )
>
> So, we are allowed to use (..) at any place in the
> context (or maybe even type), to show the compiler
> that you know "something" should be there.

I could see what your post was leading up to before I reached the bit above,
and I like the idea, but I was surprised about the syntax. I was expecting
something like this:

  foo :: (?c1, ?c2) => a -> b -> c
  bar :: (Bar a) => a -> ?t -> ?t -> ?s

The advantage of this syntax is that you can indicate that two parts of a
type should be identical. Think of it as "metaquantification," and the
binder is invisible, like in Haskell's usual syntax for type variables.

--FAC

Reply via email to