Re: [Haskell-cafe] Constraints as a moveable feast?

On *Tue Sep 1 21:18:40 UTC 2020, ** Richard Eisenberg wrote:*
*> *I see the core idea as a fairly straightforward generalization of the "Partial Type Constructors" work Ah. Now I see a bit more of what you're getting at. We want as if the type synonym were an associated type family with a most-general instance class Num a => CPoint a where type Point a instance Num a => CPoint a where type Point a = (a, a) The semantics to be as the PTC paper, such that expanding `Point a` always requires a `CPoint a` instance, which will in turn want a `Num a`. And the expansion to be immediate (as with type synonyms) so that the client can put `Point a` in instance heads, for example.
But I really don't know what it means to expand without adding parens. ... what about
*pointX :: Point a -> a*
*> ... *We don't want that type to expand to (Num a => (a, a)) -> a Ok, it was your using fancy type operators that put me off. We can represent the AST (and show the need for parens) by reverting to prefix syntax, within H98: pointX :: (->) (Point a) a -- needs parens around (Point a) And yes my naieve syntactic expansion would give the type you show, wot we do not want. AntC
participants (1)
-
Anthony Clayden