Overloaded record fields

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Mon Jun 24 11:47:09 CEST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 24/06/13 08:44, Adam Gundry wrote:
> Hi everyone,
> 
> I am implementing an overloaded record fields extension for GHC as
> a GSoC project. Thanks to all those who gave their feedback on the 
> original proposal! I've started to document the plan on the GHC
> wiki:
> 
> http://hackage.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/Plan
>
>  If you have any comments on the proposed changes, or anything is
> unclear about the design, I'd like to hear from you.
> 
> Thanks,
> 
> Adam Gundry
> 
> _______________________________________________ 
> Glasgow-haskell-users mailing list 
> Glasgow-haskell-users at haskell.org 
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
> 
On the wiki, you say ` It is critical to support dot-notation.' and
then you follow up with multiple reasons on why this is troublesome
because of the conflict with function composition.

You say `There is an overlap with the function composition operator,
but that is already true with qualified names.'

True, but qualified names always have LHS starting with a capital
letter while records wouldn't. I don't see how this is a supporting
argument.

Then you write:
    Function composition will only work when surrounded by spaces,
thus (f . g).
    Dot-notation for record selection only works with no spaces.

Restricting function composition to have spaces around it will require
changing a large amount of existing code if one is willing to use it.
While I personally would like the restriction because I hate seeing
people skimp out on whitespace around operators, there are a lot of
people with a different opinion than mine and I imagine it'd be a
great inconvenience to make them change their code if they want to
start using SORF. Have you considered not using a dot to begin with? I
imagine the reason behind the dot is that it makes it look like
methods on objects in OO languages which is a rather poor justification...

- -- 
Mateusz K.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iQIcBAEBAgAGBQJRyBWdAAoJEM1mucMq2pqXD08P/3MhVNa9GnuIABb5MT8gAq3Z
yuV/NJE4briRwtoM9ki2hciRbTluY0t7F0WlcjDgwmd2c7tO7XzGZFwx6RwsVQM6
4/fQ2jo2/HKR5+6IX3CF2zkKZGyZSUdaqdGFLUbTNw/VYnU7sP9l4TyvpEEB7P78
tCoycZ193qwH0V7I7Am57PSebFKtgKhmjXU9HKLT3wa1HRcFY5UDgi4fj/EoAHG+
ZAmxlg+8NhLbnR3lHNXC+8vUo6eG6TEf50Qn2MJNMW2CHSl8OyN+yFzTI0OO4yEK
gIirzzwz+hp4X/WOKVwUnRasv/j9EjTDx1f3ZwoJlT6UAKwh+TUxDNn8oIgLEyxi
9Vik73kvyCBBaWq8/K5CGYGtRrYQurZHBdxtfmiPe8HWWwYhNY2UKkEpKQhxzQJ2
aIl9coocdHWpbAW201dYBXkmC+Ey/oXDbubL/csaXH1kRF0HXghUacUIhIiYedk0
o5mySfd6SnsQ/Kqzjj2HM5Q0ib+5ExYmOgI21hEmWqjeeOz/oKamgaPTcrbXhWaQ
IY9isLnZwOYziGF6gs16TNfSvy8NCARCW03NjxM8gDxgXAC60ZNivZsfJ2ErjxY6
4cPqMmkXNbVTNssMbc+h4dpDGiQkwxrZKOP+RY1dp0mFtE7uY27RPRYgyW9LXfyO
L5EqGQoT18iVh7BZ7Ra7
=mkvJ
-----END PGP SIGNATURE-----



More information about the Glasgow-haskell-users mailing list