> On Apr 23, 2018, at 6:56 AM, Alan & Kim Zimmerman <alan.z...@gmail.com> wrote:
> 
> Is there any way to express that `pass` must be valid for each value of 
> `Pass` in the following instance head?
> 

No, there isn't. And for good reason: whatever you're trying to do likely 
requires some runtime decision-making, and that's impossible with just 
type-level information. (Even without that motivation, there's this: any way of 
doing this would likely break type soundness. See #7259 and #14420.)

My recommendation is to have

> class ValidPass p
> instance ValidPass Parsed
> instance ValidPass Renamed
> instance ValidPass Typechecked

My guess is that you'll need to add a method to ValidPass, anyway.

Richard
_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Reply via email to