-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I like to barbie so I tried to barbie while I barbied; but I got a type error. #47
Comments
Maybe this part of the documentation is relevant - https://hackage.haskell.org/package/barbies-2.0.0.0/docs/Barbies.html#g:3 - but the example doesn't compile, and the link to "see more" is empty 😅 |
|
Solved:
|
The trouble is that only works at one level, if you then go and embed
The trouble is how to define the FunctorT/B instances; it just doesn't seem there's a way.
is clearly wrong, as What are the options here? Thanks! |
Hi @silky, sorry for the late reply. As you probably noticed, it is not possible to have a FunctorB instance for something like:
This is not a limitation of the library, but it's just not possible to write a manual instance either. If you try, you'll end up wth something similar to:
If you only need one level of this, then using btmap1, as you saw, does the trick. But this doesn't generalize to more levels. edit: removed alternative suggestion that wouldn't really work |
Thanks for the response @jcpetruzza . I'm revisiting this now and still looking around for an answer :) I tried barbies-layered but I didn't have much luck (there's no default Would be lovely if there was a solution :) |
As I said, I don't think you'll be able to make this work given the type of One could define a different class hierarchy, e.g one where |
I'm having trouble trying to wrap a barbie in a barbie, I think; but to me it's something htat seems pretty reasonable.
Consider:
There is a type-error on the
Covered
instance:I'm not too sure how to go about solving this. Any advice would be appreciated!
Some more context: https://discourse.haskell.org/t/trouble-with-barbies/8344/4
The text was updated successfully, but these errors were encountered: