AW: RE: Hi. I'm new to this mailing list and have a few questions.

Brandon Allbery allbery.b at gmail.com
Tue Aug 4 18:37:05 UTC 2020


It's represented the same way but handled differently; my point, though,
was more about it being consistent with the rest of the language, which is
less about how the compiler handles it than about how it looks to the
programmer. In this case, _ is consistently used to mean a wildcard of some
kind, even though it has to be handled by the compiler in multiple places
including TypeApplications and PartialTypeSignatures (others include
patterns, typed holes, and let bindings as an extension of simple patterns).

On Tue, Aug 4, 2020 at 2:27 PM Anselm Schüler (conversations subemail) <
conversation at anselmschueler.com> wrote:

> That’s true, but type wildcards without PartialTypeSignatures throw an
> error, while this doesn’t need that (which suggests that they’re
> represented differently internally — I don’t know, of course). Also, there
> are other drawbacks discussed in the ghc-proposals Proposal
> 0042-named-type-args
> <https://github.com/ghc-proposals/ghc-proposals/pull/196> that was
> mentioned by Vladislav Zavialov <vladislav at serokell.io>. Which is, I
> think, it seems, where the discussion should take place (?).
>
>
>
> *Anselm Schüler*
>
> *www.anselmschueler.com* <http://www.anselmschueler.com>
>
> *mail at anselmschueler.com* <mail at anselmschueler.com>
>
>
>
> *From: *Brandon Allbery <allbery.b at gmail.com>
> *Sent: *Tuesday, August 4, 2020 20:16
> *To: *Anselm Schüler (conversations subemail)
> <conversation at anselmschueler.com>
> *Cc: *Rowan Goemans <goemansrowan at gmail.com>; ghc-devs at haskell.org
> *Subject: *Re: AW: RE: Hi. I'm new to this mailing list and have a few
> questions.
>
>
>
> _ already has the meaning of a type wildcard (generalized from its use as
> a wildcard in patterns), so this
>
> is consistent with its use in other type signatures. The problem I see
> with your proposal is that it assumes
>
> you know the names of the type variables in the original declaration.
>
>
>
> On Tue, Aug 4, 2020 at 2:12 PM Anselm Schüler (conversations subemail) <
> conversation at anselmschueler.com> wrote:
>
> And also, it’s really weird and seems like a feature that should be
> removed IMO. It kind of looks like the type variable _ is always
> in-scope, and it’s unclear if the type of the resulting function is just
> type variables without an explicit forall or if _ has a special meaning.
>
>
>
> *Anselm Schüler*
>
> *www.anselmschueler.com <http://www.anselmschueler.com>*
>
>
>
> *From: *Anselm Schüler (conversations subemail)
> <conversation at anselmschueler.com>
> *Sent: *Tuesday, August 4, 2020 20:09
> *To: *Rowan Goemans <goemansrowan at gmail.com>; ghc-devs at haskell.org
> *Subject: *RE: AW: RE: Hi. I'm new to this mailing list and have a few
> questions.
>
>
>
> True, but this makes the type less readable since id @_ :: _ -> _.
>
>
>
> *Anselm Schüler*
>
> *www.anselmschueler.com <http://www.anselmschueler.com>*
>
>
>
> *From: *Rowan Goemans <goemansrowan at gmail.com>
> *Sent: *Tuesday, August 4, 2020 19:59
> *To: *ghc-devs at haskell.org <ghc-devs at haskellorg>
> *Subject: *Re: AW: RE: Hi. I'm new to this mailing list and have a few
> questions.
>
>
>
> Just as a heads up. You can achieve what you want already by doing:
>
> f @_ @([String]) *:: forall a. (a, [String]) -> ([String], a**) *
>
> Best regards,
>
> Rowan Goemans
>
> On 8/4/20 7:45 PM, Anselm Schüler (conversations subemail) wrote:
>
> Thank you for the nice introduction :) !
>
> I will check out the GHC proposals site.
>
> And following Simon’s (I hope addressing with first name is OK)
> suggestion, I’m going to give an outline of the idea.
>
>
>
> The idea is to extend type application syntax to enable explicit
> assignment of types to specific type variables.
>
> For instance, say I have f :: forall a b. (a, b) -> (b, a), and I want to
> apply the type [String] to it. My only option is to do
>
> f @([String]) *:: forall b. ([String], b) -> (b, [String]) *
>
> —but what if, instead, I want a function of type forall a. (a, [String])
> -> ([String], a)?
>
> I propose the following syntax:
>
> f @{b = [String]} *:: forall a. ([String], b) -> (b, [String])*
>
> This wouldn’t break any existing programs since using record syntax here
> is already disallowed and met with an error message.
>
> A question is of course the symbol used for assignment (~, =, ::, or ->?).
>
>
>
> I hope the code shows up as a monospace font on your end. I used the IBM
> Plex Mono font, which is open-source <https://github.com/IBM/plex>.
>
>
>
> *Anselm Schüler*
>
> *wwwanselmschueler.com <http://www.anselmschueler.com>*
>
> *mail at anselmschueler.com <mail at anselmschueler.com>*
>
>
>
> *From: *Simon Peyton Jones <simonpj at microsoft.com>
> *Sent: *Tuesday, August 4, 2020 18:44
> *To: *Richard Eisenberg <rae at richarde.dev>; "Anselm Schüler
> (conversations subemail)" <conversation at anselmschueler.com>
> *Cc: *ghc-devs at haskell.org
> *Subject: *RE: Hi. I'm new to this mailing list and have a few questions.
>
>
>
> Welcome Anselm  ghc-devs is a very informal mailing list, and we welcome
> newcomers.
>
>
>
> For example, I have a feature idea in the back of my mind, which I imagine
> would be easy to implement
>
>
>
> What Richard says is right, but you should feel free to fly the kite on
> this list if you want – or on Haskell Café – to get some idea of whether
> others seem warm about the idea, before writing a full proposal.
>
>
>
> Simon
>
>
>
> *From:* ghc-devs <ghc-devs-bounces at haskellorg>
> <ghc-devs-bounces at haskell.org> *On Behalf Of *Richard Eisenberg
> *Sent:* 04 August 2020 16:05
> *To:* "Anselm Schüler (conversations subemail)"
> <conversation at anselmschuelercom> <conversation at anselmschueler.com>
> *Cc:* ghc-devs at haskell.org
> *Subject:* Re: Hi. I'm new to this mailing list and have a few questions.
>
>
>
> Hi Anselm,
>
>
>
> Welcome!
>
>
>
> A good way of getting used to a list like this one is to wait a little
> while and observe what kind of messages others send; this will give you a
> feel for how the list is used. If you're impatient, you can also check out
> the archives at https://mail.haskell.org/pipermail/ghc-devs/
> <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.haskell.org%2Fpipermail%2Fghc-devs%2F&data=02%7C01%7Csimonpj%40microsoft.com%7Ce68e6131af494519061c08d83887d962%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637321503404154244&sdata=w4QIMTGeMQ35bEo4xkOn2rIj8z02iMVje4Ar9AXM22k%3D&reserved=0>
> .
>
>
>
> As for a feature request: if your feature changes the language GHC accepts
> (most do), the right place to post is at
> https://githubcom/ghc-proposals/ghc-proposals
> <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fghc-proposals%2Fghc-proposals&data=02%7C01%7Csimonpj%40microsoft.com%7Ce68e6131af494519061c08d83887d962%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637321503404164244&sdata=ogVVk5kRFXPc81dZ%2FiyGV9FbgQoQUtzazpFGcrAKUXA%3D&reserved=0>.
> There is a description of how to proceed on that page. Proposals submitted
> there get debated within the community and then eventually sent to a GHC
> Steering Committee for a vote on acceptance or rejection. Then, we worry
> about implementing it. If you have a suggestion that does not change the
> language GHC accepts, you can post an Issue at
> https://gitlab.haskell.org/ghc/ghc/
> <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.haskell.org%2Fghc%2Fghc%2F&data=02%7C01%7Csimonpj%40microsoft.com%7Ce68e6131af494519061c08d83887d962%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637321503404164244&sdata=tg40q%2B9%2BW5KcVzHsPx9oCP7wdw5ipdZCOOdFnzUz3mU%3D&reserved=0>
> .
>
>
>
> I hope this is helpful!
>
> Richard
>
>
>
> On Aug 4, 2020, at 8:59 AM, Anselm Schüler (conversations subemail) <
> conversation at anselmschueler.com> wrote:
>
>
>
> First of all, in general, I’m new to mailing lists (as used for
> discussions) in general, so a question about that:
>
> When subscribed to the mailing list, do you get *every* message, or are
> some discussions hidden?
>
>
>
> Second of all, I’d like to know what kinds of messages are appropriate
> here. I’m not familiar with coding compilers or anything of the like, so
> I’m somewhat afraid of offering unhelpful comments or being just woefully
> underqualified to participate here.
>
> For example, I have a feature idea in the back of my mind, which I imagine
> would be easy to implement (that might be wrong). Is it alright if I submit
> that here or should I use some other forum?
>
>
>
> Thank you in advance for the answers.
>
>
>
> *Anselm Schüler*
>
> *www.anselmschueler.com
> <https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.anselmschueler.com%2F&data=02%7C01%7Csimonpj%40microsoft.com%7Ce68e6131af494519061c08d83887d962%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637321503404164244&sdata=WJBJ3P%2BFUnTmVs9Z97DHLat9mHr6vC22l0mQ36nafGc%3D&reserved=0>*
>
> *mail at anselmschueler.com <mail at anselmschueler.com>*
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
> <https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.haskell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fghc-devs&data=02%7C01%7Csimonpj%40microsoft.com%7Ce68e6131af494519061c08d83887d962%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637321503404174237&sdata=9y99aKPjfvm7WIH5Xv9JDlN7TIXdVPJZF%2BvAgbUvBUU%3D&reserved=0>
>
>
>
>
>
>
>
> _______________________________________________
>
> ghc-devs mailing list
>
> ghc-devs at haskell.org
>
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
>
>
>
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
>
>
>
> --
>
> brandon s allbery kf8nh
>
> allbery.b at gmail.com
>
>
>


-- 
brandon s allbery kf8nh
allbery.b at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20200804/0776616b/attachment.html>


More information about the ghc-devs mailing list