Given
class ProblemC c where
data ProblemData c :: * -> *
embedC :: (ProblemData c x ~ x) => x -> c x
data TestThing a f
= TestA a
| TestB f
deriving Functor
instance (ProblemData (TestThing a) x ~ a) => ProblemC (TestThing a) where
data ProblemData (TestThing a) b = TestData a
embedC = TestA
How do I get something that type checks?
Essentially I want a class that will embed (and extract, not included in example code) some parameterized type.
Thanks to the question from Silvio I figured it out. What I wanted: