[ghc-steering-committee] Proposal #23: instance force
Simon Peyton Jones
simonpj at microsoft.com
Fri Apr 28 07:40:52 UTC 2017
| that I deliberately avoided talking about “Wanted” constraints and
| other Outside-In terminology, which I consider implementation details
| and which a language feature specification should, if at all possible,
| avoid. I might not have succeeded in giving a good specification, but
I agree with that, and it's a valid criticism of my language. However, if you want to reason about what type should be inferred for
f x = x==x && x>x
(which is a user-facing thing, totally part of the language spec), then it's probably easier to say
"From the use of (==) you get a wanted (Eq a) constraint, where x::a. From the use of (>) you get a wanted (Ord a). Both can be derived from a Given (Ord a)." or language like that. Understanding typing rules is, I think, harder.
Moreover, it's quite hard to explain fundeps using typing rules. (Try it!) I was trying to draw the analogy, since we already have fundeps.
Simon
| -----Original Message-----
| From: ghc-steering-committee [mailto:ghc-steering-committee-
| bounces at haskell.org] On Behalf Of Joachim Breitner
| Sent: 28 April 2017 01:20
| To: ghc-steering-committee at haskell.org
| Subject: Re: [ghc-steering-committee] Proposal #23: instance force
|
| Hi,
|
| I’ll try to refrain from pouncing on every point raised, and I am not
| trying to sway anyone’s mind (I don’t feel very strongly about the
| proposal and will not shed a tear if it does not go through), but
| allow me to comment on
|
| Am Donnerstag, den 27.04.2017, 22:56 +0000 schrieb Simon Peyton Jones:
| > No need to do this ill-specified "change the type of imported
| > functions" stuff.
|
| that I deliberately avoided talking about “Wanted” constraints and
| other Outside-In terminology, which I consider implementation details
| and which a language feature specification should, if at all possible,
| avoid. I might not have succeeded in giving a good specification, but
| there is a rather clear picture in my head, so I can clarify if there
| are open questions.
|
| > It'd work fine for
| > instance force C [a]
| > too, which the proposal doesn't allow.
|
| Not quite true. If there is a
|
| instance C [a]
|
| in scope around, then
|
| instance force C [a]
|
| would work fine.
|
|
| But you are right that the current wording (“from an empty context”)
| would prohibit it if the instance
|
| instance D a => C [a]
|
| where in scope.
|
| Should the tides turn (which seems unlikely) I can improve this part.
|
| Greetings,
| Joachim
|
|
|
|
| --
| Joachim Breitner
| mail at joachim-breitner.de
|
| https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jo
| achim-
| breitner.de%2F&data=02%7C01%7Csimonpj%40microsoft.com%7C4dbafc73718744
| 86953b08d48dcc51fe%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636289
| 356110063073&sdata=Zs%2BSqmtdFn7a%2Fvy7h2KC1m%2Fu%2Bj3DiOLHzSoIJ7y8BgM
| %3D&reserved=0
More information about the ghc-steering-committee
mailing list