f-o-a-m / purescript-web3

a purescript library for the web3 api
Apache License 2.0
127 stars 24 forks source link

Add Newtype instance derivations #39

Closed XertroV closed 6 years ago

XertroV commented 6 years ago

Just adding newtype instance derivations to the relevant places.

This lets us use functions like wrap, unwrap, over, etc to easily access the internal data.

See: https://pursuit.purescript.org/packages/purescript-newtype/2.0.0/docs/Data.Newtype#t:Newtype

Note: I didn't add it to types like HexString or Address because manipulating the internal data could corrupt them. (e.g. lifting a function to replace all instances of 0 with z in a HexString is not something that we really want to allow)

martyall commented 6 years ago

awesome, thanks!