Replies: 1 comment 3 replies
-
I was not aware that it is possible, thank you! It is even more suited to Iron since everytime you import given from the lib, you generally star import the package (i.e However, is this behaviour wanted by Scala or is it a bug/trick that could be patched in a new version? Also, I struggle to find an example that declares |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've prepared the following standalone example to showcase in my upcoming book, and I was wondering if we could do better regarding the import of many
given
instances.Without the explicit
given
imports, this code would not compile.Ideally, no explicit
given
should be visible. This is doable by having instances declared in companion objects directly, you can look at how Cats does it, for example.If this sounds too complicated, I think we can get away with a single
given
import.This could re-export the instances of
numeric
,collection
,string
andany
to give a better user experience.What do you think?
PS. I'd be happy to have a go at this if you agree with either solution (I'd prefer the former, no
given
s 😃)Beta Was this translation helpful? Give feedback.
All reactions