[Haskell-cafe] Named field syntax

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Fri Aug 29 10:31:52 EDT 2008


On 2008 Aug 29, at 9:30, Maurí cio wrote:
> However, this doesn't:
>
> data Test = Test Integer {b::String}
>
> Is there some way to name only a single, or a few,
> of some data type fields?


There's no shorthand for it, no (and therefore you can't get one that  
works for pattern matching).  Personally, I haven't found it a  
hardship, because you can always used the unnamed field syntax.

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Haskell-Cafe mailing list