
On Mon, Jul 18, 2011 at 9:44 AM, Yitzchak Gale
Christopher Done wrote:
For this there is Data.Default in data-default: http://hackage.haskell.org/packages/archive/data-default/0.2.0.1/doc/html/Da...
You don't need the added complexity of a type class for this - just define the default value.
I don't think it's a case of necessity. It just happens to be very convenient to be able to use the three letters "def" instead of "defaultFrobnicatorSettings" or something like that. Michael
The case where you need a class for default values is when you're using generics. See, for example, System.Console.CmdArgs.Default in Neil Mitchell's cmdards package[1].
Regards, Yitz
[1] http://hackage.haskell.org/package/cmdargs
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners