Proposal: Dot as Postfix Function Apply

Andrew Gibiansky andrew.gibiansky at gmail.com
Thu Nov 5 01:23:40 UTC 2015


Perhaps someone could test it out by implementing it as part of ghc-reskin
<https://github.com/gibiansky/ghc-reskin>?

Personally, I do feel like we need a better way to evolve the *syntax* of
the language. The syntax is a minor concern, so almost all syntactic
proposals get voted strongly down for all the reasons brought up above.
However, syntax when taken all together is certainly not minor.

On Wed, Nov 4, 2015 at 4:19 PM, Greg Weber <greg at gregweber.info> wrote:

> +1 for an opt-in extension. I am not sure if any approval is needed from
> the libraries committee for an optional extension like this if you are
> willing to do the work to bring it to fruition yourself.
>
> On Wed, Nov 4, 2015 at 2:44 AM, Jeremy <voldermort at hotmail.com> wrote:
>
>> Dot as Postfix Function Apply
>> (
>> https://ghc.haskell.org/trac/ghc/wiki/Records/DeclaredOverloadedRecordFields/DotPostfix
>> )
>> was originally part of ORF, but dropped to keep the scope/discussion more
>> manageable. Now that ORF is in for GHC 8.0, I would like to re-propose dot
>> postfix syntax.
>>
>> The idea is that instead of
>>
>> (title person) ++ " " ++ (firstName person) ++ " " ++ (lastName person)
>>
>> we could have
>>
>> person.title ++ " " ++ person.firstName ++ " " ++ person.lastName
>>
>> This is a simple source-to-source translation with no changes to the type
>> system (TDNR is an orthogonal proposal). The advantages are:
>>
>>   1. Code that's easier to read/write.
>>   2. Familiar to users of almost every other programming language.
>>   3. IDE auto-complete - an IDE can suggest functions applicable to the
>> variable after typing .
>>
>> This would be an opt-in extension.
>>
>> I'm posting this to the libraries list because that's where proposals
>> generally go, although this isn't strictly a library issue. If it should
>> be
>> on a different list I'll move it.
>>
>>
>>
>> --
>> View this message in context:
>> http://haskell.1045720.n5.nabble.com/Proposal-Dot-as-Postfix-Function-Apply-tp5821620.html
>> Sent from the Haskell - Libraries mailing list archive at Nabble.com.
>> _______________________________________________
>> Libraries mailing list
>> Libraries at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>>
>
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20151104/883e0a5c/attachment.html>


More information about the Libraries mailing list