Closed maxigit closed 7 years ago
Unfortunately, hfoldMap
is not enough to propagate Show
constraints.
I added hfoldMapFor
in a29cf9c. Try the following code:
hfoldMapFor (Proxy :: Proxy (KeyValue KnownSymbol Show)) (show . runIdentity . getField)
That's great. I'll have a look at it.
Could you explain why Forall
doesn't work in that particular case ? I thought that was the point of it.
Thank you for reporting, I hadn't come up with these functions.
In the argument of hfoldMap
, the qualification is just forall x
, so the function doesn't know anything about x
. Due to the limitation of the type system, you need to specify a constraint explicitly.
I'm evaluated this package so I've been trying a few thing on the repl. I would like to transform a record to a list of string for that I'm using
hfoldmap
. I can't get it to compile and get the following error message(I know this is not the exact code I need, but I should be able to get what I want, once I get that to compile).
Is it possible to make it work ?
Thanks/