The data-default-extra package
An alternative to data-default package, that provides a lot of additional instances for Default type class.
Default type class provides a default value (def) of a type. In case when a particluar type has an instance for Monoid, then the default value should be mempty, otherwise it can cause a great deal of confusion.
One must understand, that Default type class, has no axioms associated with it. Its purpose is to minimize:
Number of imports.
Number of introduced definitions that are part of an API.
Complexity of building more complicated "default values" out of simpler "default values".
Cognitive overhead. (Reduction of cognitive overhead is partially a consequence of reducing above issues.)
As one may notice, most of the listed problems, that Default type class tries to solve, to various degrees of success, are for human benefit, and not theoretically founded. Because of this, please always try hard to define sensible instances of Default. Most importantly, document what def means for particular type, and always check that def is sensible, by testing it on a real world sample of human beings, one is not a big enough sample.
That said, using Default may not always be a good idea. If it breaks people's mental model, or theoretical models with real axioms, then just don't use it.
[Skip to Readme]
|with-bytestring||Provide instances for (lazy and strict) ByteString, ByteString Builder and for ShortByteString.||Enabled||Automatic|
|with-case-insensitive||Provide instance for CI (Case Insensitive) type wrapper.||Enabled||Automatic|
|with-containers||Provide instances for Set, Map, IntMap, IntSet, Seq, and Tree.||Enabled||Automatic|
|with-dlist||Provide instance for DList type.||Disabled||Automatic|
|with-text||Provide instance for (strict and lazy) Text and Text Builder.||Enabled||Automatic|
|with-old-locale||Provide instance for TimeLocale type.||Enabled||Automatic|
|with-unordered-containers||Provide instances for HashMap and HashSet.||Enabled||Automatic|
|with-vector||Provide instances for various (boxed and unboxed) Vector types.||Enabled||Automatic|
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
For package maintainers and hackage trustees