Records (was Re: [Haskell] Improvements to GHC)

Gracjan Polak gracjanpolak at gmail.com
Tue Nov 22 04:15:51 EST 2005


2005/11/20, Georg Martius <mai99dgf at studserv.uni-leipzig.de>:
> 7. Unordered records.
>         I don' t understand it.
>

Consider this example:

data DataT = DataT (Int,String) (String,String)

if we treat records as tuples with labels, then we could write:

data DataR = DataR {tel::Int,addr::String} {zip::String,state::String}

so we could have more records per sum-type case. It is also good
because constructor arity stays the same, in this case both DataT and
DataR have arity 2.

What do you think?

--
Gracjan


More information about the Haskell mailing list