
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 example: data Contract = Contract { currency :: Currency , payments :: Double , contracts :: [Contract] } deriving (Show) urContract = Contract { currency = undefined, payments = undefined, contracts = [] } one :: Currency -> Contract one c = urContract { currency = c, payments = 1} and :: Contract -> Contract -> Contract (and) c1 c2 = urContract { contracts = [c1, c2] } ____________________ David Place Owner, Panpipes Ho! LLC http://panpipesho.com d@vidplace.com On Jul 17, 2011, at 6:03 PM, Costello, Roger L. wrote:
Hi Folks,
Can fields in a record be made "optional"?