If I've got a function:
f :: c u => t -> m u
and a list:
x :: [t]
How can I produce a list:
y :: [forall v. c v => m v]?
Why?
Well I'm trying to populate a product type from a list of "rawdata.
Now I have a function:
read :: (SomeMonadError m, CanRead a) => RawData -> m a
Which can parse any input data either with success or failure.
I've also got a function:
populateProductType :: (Generic a, Applicative f, (some other constraints)) => [forall b. c b => f b] -> f a
Which given a product type a, of which all it's constituents are constrained by c, will happily go through and populate a, just by repeatedly applying the applicative, which nicely catches any parse errors.
This is all good except I don't seem to be able to produce the polymorphic list I need to pass to populateProductType.