data-default WAS: [containers] Proposal: Change to the Data.Map Monoid
John Wiegley
johnw at newartisans.com
Thu May 22 00:43:31 UTC 2014
>>>>> Bryan O'Sullivan <bos at serpentine.com> writes:
> I agree. Default is the bad kind of trivial: it gives you nothing, but in
> exchange takes away type inference and the ability to choose different
> defaults for varying circumstances. I wouldn't support adding it to base,
> and prefer to avoid packages that use it.
I feel similarly, Bryan. All Data.Default seems to achieve is to overload a
single name to... save typing?
If I'm already reading the documentation for a function I need to call,
there's no reason the documentation can't also mention the default value I
should be using, hopefully with an example of what typical specializations
look like.
Having the name 'def' gives me little added benefit, since I don't know what
to do with the value other than pass it. And if that's going to be how it's
used the majority of the time, the library author could just provide a variant
of the function which assumes the default.
John
More information about the Libraries
mailing list