f-o-a-m / purescript-web3

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

Purs 0.15 #161

Closed iostat closed 1 year ago

iostat commented 1 year ago

NOTE: Before merging this, merge https://github.com/f-o-a-m/purescript-eth-core/pull/32 and tag it with a proper version so that packages.dhall doesn't have to refer to some arbitrary commit -- then update packages.dhall

Prior to merging this PR, there's another PR which is simply this one + the result of running purs-tidy on it. Due to the massive amount of changes introduced by code formatting, I've separated it to make reviewing this PR a bit easier -- but it should be merged into this branch first That can be found at https://github.com/f-o-a-m/purescript-web3/pull/162

This one was similarly rote to eth-core:

Additionally, some other goodies came out of this:

The bad/ugly:

martyall commented 1 year ago

also I'm getting some warnings on a clean build

[24/27 HiddenConstructors] src/Network/Ethereum/Web3/Types/Types.purs:1:1

       v
    1  module Network.Ethereum.Web3.Types.Types
    2    ( BlockNumber(..)
    3    , ChainCursor(..)
       ...
  683      NullError -> writeImpl { result: _null }
  684      RemoteError _remoteError -> writeImpl { _remoteError }
  685      ParserError _parserError -> writeImpl { _parserError }
                                                                ^

  An export for Filter hides data constructors but the type declares an instance of Data.Generic.Rep.Generic.
  Such instance allows to match and construct values of this type, effectively making the constructors public.

[25/27 HiddenConstructors] src/Network/Ethereum/Web3/Types/Types.purs:1:1

       v
    1  module Network.Ethereum.Web3.Types.Types
    2    ( BlockNumber(..)
    3    , ChainCursor(..)
       ...
  683      NullError -> writeImpl { result: _null }
  684      RemoteError _remoteError -> writeImpl { _remoteError }
  685      ParserError _parserError -> writeImpl { _parserError }
                                                                ^

  An export for Filter hides data constructors but the type declares an instance of Data.Newtype.Newtype.
  Such instance allows to match and construct values of this type, effectively making the constructors public.

[26/27 HiddenConstructors] src/Network/Ethereum/Web3/Types/Types.purs:1:1

       v
    1  module Network.Ethereum.Web3.Types.Types
    2    ( BlockNumber(..)
    3    , ChainCursor(..)
       ...
  683      NullError -> writeImpl { result: _null }
  684      RemoteError _remoteError -> writeImpl { _remoteError }
  685      ParserError _parserError -> writeImpl { _parserError }
                                                                ^

  An export for FilterId hides data constructors but the type declares an instance of Data.Generic.Rep.Generic.
  Such instance allows to match and construct values of this type, effectively making the constructors public.

[27/27 HiddenConstructors] src/Network/Ethereum/Web3/Types/Types.purs:1:1

       v
    1  module Network.Ethereum.Web3.Types.Types
    2    ( BlockNumber(..)
    3    , ChainCursor(..)
       ...
  683      NullError -> writeImpl { result: _null }
  684      RemoteError _remoteError -> writeImpl { _remoteError }
  685      ParserError _parserError -> writeImpl { _parserError }
                                                                ^

  An export for Request hides data constructors but the type declares an instance of Data.Generic.Rep.Generic.
  Such instance allows to match and construct values of this type, effectively making the constructors public.