[Haskell-cafe] Type wildcards

Edsko de Vries devriese at cs.tcd.ie
Tue Dec 16 10:39:54 EST 2008


Hi,

On Tue, Dec 16, 2008 at 05:26:00PM +0200, Eyal Lotem wrote:
> Martin Foster (aka. EvilTerran) suggested an interesting idea, and I decided
> it was too nice to ignore/be forgotten inside Martin's head... So I'd like
> to try and suggest it.
> 
> Type wildcards that allow partially specifying types, e.g:
> 
> f :: _ -> String
> f x = show x
> 
> This will instruct the type-inferrer to "fill out" the wild-card part only
> (e.g: Show a => a).

What you are describing is (an instance of) the "some" operator. For
example, see

http://research.microsoft.com/en-us/um/people/daan/download/papers/hmf.pdf

Section 5.1, "Partial annotations".

And yes, I agree, they are useful :)

Edsko


More information about the Haskell-Cafe mailing list