Re: How to user-define a type equality constraint?

2021-04-06 Thread Carter Schonwald
That sounds like a bug/oversight! Is that not fixed in 9.2? On Mon, Apr 5, 2021 at 11:08 PM David Feuer wrote: > `Char` is defined in user code. What you really can't define are Char# and > TYPE, and you can't modify `RuntimeRep`. Speaking of `Char#`, I see that in > 9.0, at least, it has kind

Re: How to user-define a type equality constraint?

2021-04-06 Thread Richard Eisenberg
> On Apr 6, 2021, at 7:44 AM, Anthony Clayden > wrote: > > > But why does this matter? > > Because I want the semantics of that equality constraint, without switching > on any of these, which I don't otherwise use: > > GADTs > TypeFamilies > TypeOperators > > And if that means I can't use

Re: How to user-define a type equality constraint?

2021-04-06 Thread Anthony Clayden
> But why does this matter? Because I want the semantics of that equality constraint, without switching on any of these, which I don't otherwise use: GADTs TypeFamilies TypeOperators And if that means I can't use infix `~` in my constraints, I'll put up with that. (I'd user-define a

Re: How to user-define a type equality constraint?

2021-04-05 Thread David Feuer
`Char` is defined in user code. What you really can't define are Char# and TYPE, and you can't modify `RuntimeRep`. Speaking of `Char#`, I see that in 9.0, at least, it has kind TYPE 'WordRep. Why is that not Word32Rep? On Mon, Apr 5, 2021, 10:50 PM Richard Eisenberg wrote: > > > On Apr 1,

Re: How to user-define a type equality constraint?

2021-04-05 Thread Richard Eisenberg
> On Apr 1, 2021, at 8:12 PM, Anthony Clayden > wrote: > > Can I user-define a conventional type-class that behaves more like `(~)`? I don't think so. But why does this matter? I can't define `Char` in user code, but it's exported from the Prelude and requires no extensions. While I can

How to user-define a type equality constraint?

2021-04-01 Thread Anthony Clayden
Type equality `(~)` is a fine constraint. It's mildly annoying I need either `-XGADTs` or `-XTypeFamilies` to use it -- because I don't otherwise need those extensions. OTOH it's not H2010 so it needs to be switched on somehow. I see the Committee is discussing what to do. It's to be enabled by