[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] wildcards for type variables?

Subject: Re: [Haskell-cafe] wildcards for type variables?
From: Antoine Latter
Date: Wed, 13 Jan 2010 07:16:28 -0600
On Wed, Jan 13, 2010 at 4:59 AM, Brandon S. Allbery KF8NH
<[email protected]> wrote:
> On Jan 13, 2010, at 05:54 , David Virebayre wrote:
>>
>> On Wed, Jan 13, 2010 at 12:29 AM, Evan Laforge <[email protected]> wrote:
>>>
>>> Occasionally I have a function with an unused argument, whose type I
>>> don't want to restrict. ÂThus:
>>>
>>> f :: _unused -> A -> B
>>> f _ a = b
>>
>> I probably misunderstood the problem, why not f:: a -> A -> B
>
>
> He's looking for the self-documentation aspect of "this argument is
> completely irrelevant". ÂNeither rolling a random unused type variable nor
> "forall"ing it (my first idea) really accomplishes that.
>

Isn't that what we have here? a function of type (a -> A -> B) cannot
use the first argument in any meaningful way.

But once you start throwing in higher ranked types you might have to
think a bit to come to that conclusion.

Antoine
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>