Hi,

Quick question - is it possible to put type class contexts on
existentially quantified variables in GADTs defined using record syntax?

E.g.

data ProofContext where
  (Reify a, Reify x) => ProofContext {
    pcProofScriptInProgress :: RPath ProofStep a ExprRoot,
    pcCursor      :: Cursor x a
  } :: ProofContext

GHC (6.8.2) parse errors on this,

and

data ProofContext where
  ProofContext {
    pcProofScriptInProgress :: RPath ProofStep a ExprRoot,
    pcCursor      :: Cursor x a
  } :: (Reify a, Reify x) => ProofContext

this is malformed.

ProofContext.hs:20:2:
    Malformed constructor result type:
      (Reify a, Reify x) => ProofContext
    In the result type of a data constructor:
      (Reify a, Reify x) => ProofContext
    In the data type declaration for `ProofContext'
make: *** [toral] Error 1


Can I also double check that the 'a' variable really is the same 'a' for
the last two fields?

Many thanks,

Tristan Allwood

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to