[Haskell-cafe] wildcards for type variables?
Brandon S. Allbery KF8NH
allbery at ece.cmu.edu
Wed Jan 13 05:59:09 EST 2010
On Jan 13, 2010, at 05:54 , David Virebayre wrote:
> On Wed, Jan 13, 2010 at 12:29 AM, Evan Laforge <qdunkan at gmail.com>
> 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.
--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university KF8NH
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20100113/c27f9bec/PGP.bin
More information about the Haskell-Cafe
mailing list