Keep the present Haskell record system!
Bulat Ziganshin
bulat.ziganshin at gmail.com
Mon Mar 6 04:23:27 EST 2006
Hello Lennart,
Monday, March 6, 2006, 9:50:24 AM, you wrote:
LA> Yes, I've read the article too. And I really like the record system.
LA> But an off-hand remark like that doesn't convince me.
my own opinion is that this scheme is like classes - they can be
resolved at compile time in most real cases but noone do it because
code will be too large. if some function can accept any records which
has field 'a' then to use this function on records of different types
we need either to do specialization or use scheme with non-constant
access time
also, while i like dynamic records for some types of tasks, i think
that the "spirit" of Haskell in whole is to give explicit definitions
of all types used and in this respect this type extension in not on
"main way". i will be glad to write smth like this:
data A = A { f1 :: Integer -- filesize
, f2 :: String -- filename
}
data B : A = B { f3 : Int -- filedate
, f4 : Int -- filetime
}
i.e. explcicitly define concrete types as a set of fields,
explicitly define types of fields and make comments just here. in this
respect, O'Haskell is what i really like
--
Best regards,
Bulat mailto:Bulat.Ziganshin at gmail.com
More information about the Haskell-prime
mailing list