1 Feb 2012 07:52
Re: Records in Haskell - namespacing for fields
AntC <anthony_clayden <at> clear.net.nz>
2012-02-01 06:52:24 GMT
2012-02-01 06:52:24 GMT
John Lask <jvlask <at> hotmail.com> writes: > > On 1/02/2012 12:26 AM, AntC wrote: > > > > No! no! no! For records _don't_ put records in nested/sub-modules, and _don't_ > > require them in separate modules (as currently). Here's how ... > > > > namespace management and record systems are intimately related, but as > you assert distinct issues. > > taking your example of Customer_id, I expressly want to be able to > define in the same syntactic module (file). Two records with a field > with exactly the same name at two different types, say Customer_id :: > Int and Customer_id :: String. As I understand it, your proposal > would not enable this. John, you can't do this now. You can't even define in the same module two records with the same name with the _same_ type. [I'd better check first why you've put Customer_id with upper case, that's a type, not a field. Are you sure what you're talking about?] I'd certainly dispute that there's anything sensible in doing that (why? what's the use case?), and I guess my proposal is not making that easy, but it is possible (and in fact no more difficult than a 'fixed' type for a field). You'd go:(Continue reading)
RSS Feed