data-default

Henning Thielemann schlepptop at henning-thielemann.de
Wed May 21 21:38:27 UTC 2014


Am 21.05.2014 20:46, schrieb Michael Snoyman:
> I honestly don't feel very strongly about usage of Default. What I've
> found it useful for is a very narrow category: a function which takes a
> configuration parameter that users likely never want to modify. For
> example: xml-conduit has various parsing and rendering settings, but
> most use cases are good with the default.

Why not defining a class in xml-conduit then? Nonetheless I think, this 
is abuse of the type system. Type classes are for writing generic code, 
not for re-use of short names.

> There's a cognitive overhead
> for a user to remember the default parameter name (is it
> defaultXMLSettings? defaultXmlSettings? defParseSettings?).

It is simple if you use qualified names consistently: 
XMLSettings.default if XMLSettings is the module that defines the XML 
configuration type.



More information about the Libraries mailing list