<div dir="ltr">Hello everyone,<div><br></div><div>I have just started studying Haskell and I am having a hard time understanding type and value constructors.</div><div><br></div><div>So to create a new type, you write something like:</div><div><br></div><div>data FinancialInstrument = Financial  String Double</div><div>                                           deriving (Eq, Show)</div><div><br></div><div>and then you can write:</div><div><br></div><div>ibm = Financial "ibm" 150</div><div><br></div><div>OK all good. This initializes a FinancialInstrument. What I don't quite grasp is what is the purpose of Financial (the data/value constructor)? And from what I have read, you could have also written:</div><div><br></div><div>data FinancialInstrument = FinancialInstrument String Double</div><div>                                           deriving (Eq, Show)</div><div><br></div><div>To me the second expression is a lot closer to the typical OOP way of doing things (where the type name and constructor(s) have the same name). Why would someone prefer the first notation?</div><div><br></div><div>Once a value has been constructed, how can I access its fields?</div><div><br></div><div>Is there a way to create values using named parameters?</div><div><br></div><div>Thanks! </div></div>