Overloaded record fields
fuuzetsu at fuuzetsu.co.uk
Mon Jun 24 11:47:09 CEST 2013
-----BEGIN PGP SIGNED MESSAGE-----
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
> If you have any comments on the proposed changes, or anything is
> unclear about the design, I'd like to hear from you.
> Adam Gundry
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
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
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...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the Glasgow-haskell-users