[Haskell-beginners] Can fields in a record be optional?

Christopher Done chrisdone at googlemail.com
Mon Jul 18 07:45:29 CEST 2011


On 18 July 2011 00:18, David Place <d at vidplace.com> wrote:
> The way I often do this is to create an "ur" instance where all the fields have default values.  Then to create an instance, I just do a "record update" of this instance.

For this there is Data.Default in data-default:

http://hackage.haskell.org/packages/archive/data-default/0.2.0.1/doc/html/Data-Default.html



More information about the Beginners mailing list