Closed XertroV closed 6 years ago
we don't really use that anywhere (transaction, receipt, etc). maybe we should include instances for all such objects if we have it for one
maybe we should include instances for all such objects
Yup - agreed. It's not used in the library but I definitely use it - I prefer block <- unwrap <$> runWeb3 ...
to (Block block) <- runWeb3 ...
and the like. Just makes it a bit more flexible.
I'll add in Newtype
derivations to other types tomorrow.
@blinky3713 - Added the rest of newtype derivations
Other changes:
Only types we don't have newtype derivations for are stuff like HexStrings (where there are good reasons for not letting people wrap
and unwrap
, etc)
@blinky3713 - FYI added some tests for newtype derivations to make sure they aren't removed (I think I added at least some of them before that got removed once).
Anyway, I'm not sure sure how best to test for derivations - basically here I just rely on the typechecker and throw away the result of any web3 computations (so it doesn't matter if a node is running or not)
If you have any better ideas please let me know.
🎉
Since we don't have lenses on
Block
fields aNewtype
instance let's us useunwrap
and the like.Not sure if we had this before or not, but noticed it was missing now.