[Haskell-cafe] Type synonym involing quantified constraint?

Michael Sperber sperber at deinprogramm.de
Tue Aug 31 15:45:32 UTC 2021


I'm working on Conal's ConCat code, and keep putting quantified
constraints like this in instance constraints:

(okk ~ Ok k, forall x y. (okk x, okk y) => okk (Prod k x y))

(The okk ~ Ok k is necessary because Ok is an associated type.)

Is there any way to define a type synonym for this?  Like

type OkProd k = (okk ~ Ok k, forall x y. (okk x, okk y) => okk (Prod k x y))

ghc (8.10.4) complains about an impredicative type.

Help would be much appreciated!

-- 
Regards,
Mike



More information about the Haskell-Cafe mailing list