[Haskell-cafe] Object oriented haskell.

silvio silvio.frischi at gmail.com
Thu May 15 18:11:41 UTC 2014


> relevantly: https://ghc.haskell.org/trac/ghc/wiki/Records/DeclaredOverloadedRecordFields/DotPostfix

Ways in which I think my implementation is superior

1) in the proposal the thing behind the dot has to be a function.
Therefore, you have to wrap everything in a function before you can use
it. Something like this is not possible

> [1,2,3] . 0
1

2) I'm not sure this proposal solves the name collision problem but that
might just be that i don't understand it.

3) my library doesn't require any additional syntax only a few already
existing extensions. And you can use a bit of template haskell to assist
the creation of objects.

4) Also the proposal doesn't mention updates but if they have to be a
function you cant use the same name as for the function to get a field.
And you simply can't beat my syntax, in which you can use the same name
for both.
object . fieldName := value -- update
object . fieldName          -- get

Silvio


More information about the Haskell-Cafe mailing list