karamaan / karamaan-opaleye

Other
11 stars 7 forks source link

Explain the use of the Default typeclass #17

Closed tomjaguarpaw closed 10 years ago

tomjaguarpaw commented 10 years ago

Users have complained that they don't understand the use of the Default typeclass. It's not actually complicated so this should be explained clearly!

Joseph Abrahamson writes: "[Default] gave me a lot of headaches—not with typechecking, but with documentation. It has a lot of instances due to all of the parameters and all of the default tuple instances which, overall, lead to a lot of documentation chasing. I'm personally not a huge fan of type-directed defaulting, I avoid data-default in my own code. I ended up as even less of a fan of it here as it adds so much type UI overhead."

There's clearly some big problem here, as Default was implemented to avoid UI overhead. We must explain the benefits clearly and help users avoid confusion.

tomjaguarpaw commented 10 years ago

This has existed for a while

https://github.com/karamaan/karamaan-opaleye/blob/c39be2cda54d3361420a69cc919ac2d3395ab4aa/Examples/DefaultExplanation.lhs