
18 Jul
2011
18 Jul
'11
6:44 a.m.
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. 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