[Haskell-beginners] Data type

Shishir Srivastava shishir.srivastava at gmail.com
Tue May 5 15:19:03 UTC 2015


Hi,

Could anyone please have a look and let me know how you can create the
instance of this data type ?

---
 data Person = Person { firstName ::String -> Int }
---

I've seen this type of syntax in a lot of places in haskell code where a
new data type is defined in terms of functions rather than concrete data
types.

I am not trying to achieve anything out of this but purely as an exercise
in understanding the record syntax.

As far as I understand the data type is function based and takes a
'function' instead of a value of a concrete type so how does one create an
instance of this type.

Thanks,
Shishir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150505/495fb13e/attachment.html>


More information about the Beginners mailing list