Re: labelled fields

2003-06-05 Thread George Russell
Steffen wrote > I need something like > > data Type = TCon String {lmtc::Maybe String} ... > > but this does not seem to be possible. Instead > I have to waste identifiers: > > data Type = TCon {senseless::String,lmtc::Maybe String} ... > > Why? Are there any formal reasons against the > above decl

Re: labelled fields

2003-06-04 Thread Hal Daume III
...it's also not the same...for instance, in this new version you cannot say: > foo = bar { thing = Nothing } which you could say given: > data Foo = Foo String { thing :: Maybe String } I'd guess that this is disallowed just for consistency. I think it would just be too many rules to keep tra

Re: labelled fields

2003-06-04 Thread Steffen Mazanek
Ok, I had missed something: I can write instead: data Type = TCon String (Maybe String) ... and declare a function lmtc lmtc (TCon _ x) = x ... But why not allow syntactic sugar? Sorry, Steffen -- Steffen Mazanek - www.steffen-mazanek.de - GPG: 791F DCB3 Haskell, that's where I just cur