Quoth AntC <anthony_clay...@clear.net.nz>,
...
> No, Donn, it's not the lack of syntax, it's the lack of semantics for first-
> class (polymorphic) record update. And there's very little that's obvious.

Ah, you're right, I certainly shouldn't have used the word "syntax" there.
But just to be clear on the point, I wonder if you could expand on what
you mean by "polymorphic" above.

I mean, when I wrote

  modifyRecord :: RecordType r => (a -> a) -> (r -> a) -> r -> r

... while this does obviously represent a polymorphic function,
if I write

  data Config { tempo :: Int, ...}
  f = modifyRecord tempo (+20)

... then f has type Config -> Config, it isn't polymorphic.
I am however vaguely aware that some parties to the Record
Question would like to make record fields themselves polymorphic, so
that 'tempo' could be defined for multiple record types and 'f'
would, I suppose, have a type like  RecordThatHasTempo r => r -> r

Maybe that's semantically more like "overloading", but in any case,
it isn't strictly necessary in order to support first class updates,
true?

        Donn

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to