[ghc-steering-committee] RecordDotSyntax: please express a view

Vitaly Bragilevsky bravit111 at gmail.com
Mon Dec 16 15:19:33 UTC 2019


Hi everyone,

Joachim and Richard, thank you very much for creating this framework to
think about this proposal. It is very helpful.

As an educator, I'd vote for rejection. My reason is that the proposal
introduces yet another style of programming in Haskell, in addition to
traditional functional and lenses-like ones. I can easily imagine imitating
object-oriented style with fields-functions and it will be too tempting to
use it by those with OO-background (and this includes almost everyone these
days given the trends in higher education). The proposal also limits ways
to use function composition (especially in sections) which is another sad
thing. I don't like all this happening to Haskell as a purely functional
PL.

Regards,
Vitaly


сб, 14 дек. 2019 г. в 14:42, Richard Eisenberg <rae at richarde.dev>:

> Your very helpful delineation of the space assumes (.) = \ f g x -> f (g
> x) and then inlines. I actually think it would be clearer not to do this. I
> have taken your taxonomy and kept (.) abstract. Some examples also left
> (x.field) uninterpreted. I have expanded these to use getField. To be
> clear, this is *not* a reproposal or intended to make *any* change to
> Joachim's dichotomy. I am just restating it a way I understand better.
> Perhaps others will also find this to be clearer. Each individual committee
> member can use *either* my presentation or Joachim's. They (are intended
> to) have *the same* semantics.
>
> Reject:
>  r.field        = (.) r field
>  f x.field y    = (.) (f x) (field y)
>  f x .field y   = (.) (f x) (field y)
>  f x (.field) y = f x (\a -> (.) a field) y
>  f x (.field y) = f x (\a -> (.) a (field y))
>
> OnlySelection:
>  r.field        = getField @"field" r
>  f x.field y    = f (getField @"field" x) y
>  f x .field y   -- NOT ALLOWED
>  f x (.field) y -- NOPE
>  f x (.field y) -- NAY
>
> SectionSelector:
>  r.field        = getField @"field" r
>  f x.field y    = f (getField @"field" x) y
>  f x .field y   -- VERBOTEN!
>  f x (.field) y = f x (\r -> getField @"field" r) y
>  f x (.field y) -- BAD!
>
> PlainSelector:        -- this is the proposal as it stands, I believe
>  r.field        = getField @"field" r
>  f x.field y    = f (getField @"field" x) y
>  f x .field y   = f x (\r -> getField @"field" r) y
>  f x (.field) y = f x (\r -> getField @"field" r) y
>  f x (.field y) = f x ((\r -> getField @"field" r) y) = f x (getField
> @"field" y) -- !
>
> Ocaml:
>  r.field        = getField @"field" r
>  f x.field y    = f (getField @"field" x) y
>  f x .field y   = f (getField @"field" x) y
>  f x (.field) y -- NOT ALLOWED
>  f x (.field y) -- CAN’T DO THAT
>
> Ocaml+Section:
>  r.field        = getField @"field" r
>  f x.field y    = f (getField @"field" x) y
>  f x .field y   = f (getField @"field" x) y
>  f x (.field) y = f (\r -> getField @"field" r) y
>  f x (.field y) -- NO NO NO
>
> JS:
>  r.field        = getField @"field" r
>  f x.field y    = (getField @"field" (f x)) y
>  f x .field y   = (getField @"field" (f x)) y
>  f x (.field) y -- IMPOSSIBLE!
>  f x (.field y) -- STOP IT PLEASE!
>
> JS+Section:
>  r.field        = getField @"field" r
>  f x.field y    = (getField @"field" (f x)) y
>  f x .field y   = (getField @"field" (f x)) y
>  f x (.field) y = f x (\r -> getField @"field" r) y
>  f x (.field y) = f x (\r -> (getField @"field" r) y)
>
> I hope this is helpful!
> Richard
> _______________________________________________
> ghc-steering-committee mailing list
> ghc-steering-committee at haskell.org
> https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20191216/189e549c/attachment-0001.html>


More information about the ghc-steering-committee mailing list