On Tue, 5 Oct 2021, David Feuer wrote:
To be clear, the proposal to allow different constraints was accepted, but
integrating
it into the current, incredibly complex, code was well beyond the limited
abilities of
the one person who made an attempt. Totally severing pattern synonyms from
const
ytonjo...@gmail.com<mailto:simon.peytonjo...@gmail.com> instead. (For
now, it just forwards to simo...@microsoft.com.)
From: Anthony Clayden
Sent: 06 October 2021 11:42
To: Simon Peyton Jones
Cc: Gergő Érdi ; GHC users
Subject: Re: Pattern synonym constraints :: Ord a => () => ...
On
On Wed, 6 Oct 2021 at 21:24, Simon Peyton Jones
wrote:
>
>
> I suggest the User Guide needs an example where a constraint needed for
> matching (presumably via a View pattern) is not amongst the
> constraints carried inside the data constructor, nor amongst those needed
> for building. Then the l
forwards to simo...@microsoft.com.)
From: Glasgow-haskell-users On
Behalf Of Anthony Clayden
Sent: 06 October 2021 06:25
To: Gergő Érdi
Cc: GHC users
Subject: Re: Pattern synonym constraints :: Ord a => () => ...
Thanks Gergö, I've read that paper many times (and the User Guide). Now
Thanks Gergö, I've read that paper many times (and the User Guide). Nowhere
does it make the distinction between required-for-building vs
required-for-matching. And since most of the syntax for PatSyns (the
`where` equations) is taken up with building, I'd taken it that "required"
means required-fo
> I'm afraid none of this is apparent from the User Guide -- and I even
> contributed some material to the Guide, without ever understanding that.
> Before this thread, I took it that 'Required' means for building -- as in for
> smart constructors.
No, that's not what the required/provided dist
If you haven't yet, it is probably a good idea to read section 6 of
https://gergo.erdi.hu/papers/patsyns/2016-hs-patsyns-ext.pdf
On Wed, Oct 6, 2021 at 10:23 AM Gergő Érdi wrote:
>
> > I'm afraid none of this is apparent from the User Guide -- and I even
> > contributed some material to the Guid
Thank you. Yes that proposal seems in 'the same ball park'. As Richard's
already noted, a H98 data constructor can't _Provide_ any constraints,
because it has no dictionaries wrapped up inside. But I'm not asking it to!
The current PatSyn signatures don't distinguish between
Required-for-building
Thank you Richard (and for the reply to a similar topic on the cafe).
What I meant by the comparison to 'stupid theta' is that GHC's
implementation of datatype contexts used to be mildly useful and moderately
sensible. Then it went stupid, following this 'Contexts on datatype
declarations' thread:
You're right -- my apologies. Here is the accepted proposal:
https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0042-bidir-constr-sigs.rst
Richard
> On Oct 5, 2021, at 12:38 PM, David Feuer wrote:
>
> To be clear, the proposal to allow different constraints was accepted, but
I meant my own brief attempt. Severing them absolutely wouldn't make them
less useful.
pattern Foo :: ...
pattern Foo x <-
constructor Foo :: ...
constructor Foo x = ...
Separate namespaces, so you can have both, and both can be bundled with a
type.
On Tue, Oct 5, 2021, 1:11 PM Edward Kmet
On Tue, Oct 5, 2021 at 12:39 PM David Feuer wrote:
> To be clear, the proposal to allow different constraints was accepted, but
> integrating it into the current, incredibly complex, code was well beyond
> the limited abilities of the one person who made an attempt. Totally
> severing pattern syn
To be clear, the proposal to allow different constraints was accepted, but
integrating it into the current, incredibly complex, code was well beyond
the limited abilities of the one person who made an attempt. Totally
severing pattern synonyms from constructor synonyms (giving them separate
namespa
> On Oct 3, 2021, at 5:38 AM, Anthony Clayden
> wrote:
>
> >pattern SmartConstr :: Ord a => () => ...
>
> Seems to mean:
>
> * Required constraint is Ord a -- fine, for building
Yes.
> * Provided constraint is Ord a -- why? for matching/consuming
No. Your signature specified that t
14 matches
Mail list logo