In the end, I solved the problem, because I also had another problem with my approach that could have been solved in this way not . This other problem was as follows:
{-
Adding type constraints to unP was essential for another solution, but it caused me problems with this. The t type parameter is used only in the St type, so I now solved the problem there using GADT. So the solution to my original problem was:
{-# LANGUAGE RankNTypes, MultiParamTypeClasses, FunctionalDependencies, GADTs #-} {-# LANGUAGE RecordWildCards #-} data St s where St :: (S st) => { use_t :: t } -> St s class S st | s -> t newtype P s = P { unP :: forall b. St s -> (St s -> b) -- pok -> b } -- Apparently the record update syntax is not fully implemented for GADTs, especially when using polymorphic fields. -- See https:
So the solution to my second problem was:
{-
Ultimately, this solution can still use the type equivalence constraints proposed by dfeuer.
source share