Skip to content
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

partially monomorphise & de-generify Env #4521

Commits on Oct 11, 2022

  1. hide-env

    Get some more privacy around the environment passed around in Action.
    This wraps the Env type alias in a discriminated union to generate type
    errors on usage, then moves direct accesses to Env and wraps the original
    usage in an API or moves the code to the Env module.
    NadiaYvette committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    6f9786c View commit details
    Browse the repository at this point in the history
  2. SetKeyVal exposes an inextricable precursor to the Generic usage in the

    Env DMap via a Generic in the Set case of Action. So this limits usage
    of the SetKeyVal type alias to the Types module momentarily to limit
    exposure of the Generic that packages key-value pairs for insertion
    into the DMap.
    NadiaYvette committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    5cbd4a3 View commit details
    Browse the repository at this point in the history
  3. Hide usage of Action Set case in setConst.

    This moves the access to the Set case of action exposing SetKeyVal into
    Types.hs; the wrapper may move again, but the caller will be insulated.
    NadiaYvette committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    b1c5479 View commit details
    Browse the repository at this point in the history
  4. Monomorphise the User case of the Store type.

    This splits it up into SNetworkId and SSocketPath and removes the old
    User constructor. A sweep is done and accessors in Env likewise changed.
    NadiaYvette committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    aab193f View commit details
    Browse the repository at this point in the history
  5. Remove Tag, Setters

    This monomorphises Action's Set case in order to remove the last
    dependencies on Setters.Tag via SetKeyVal. The Setters file is
    removed from the tree and the cabal file as well.
    NadiaYvette committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    8ddfaed View commit details
    Browse the repository at this point in the history
  6. Remove unSet & consumeName

    There are no callers outside Env.
    NadiaYvette committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    64ccd8d View commit details
    Browse the repository at this point in the history
  7. Fold Name into Store

    This trades in the Named case of Store for the various cases of Name.
    getName & setName are bypassed in favour of get/set of the Store
    directly.
    NadiaYvette committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    d707426 View commit details
    Browse the repository at this point in the history
  8. Remove [gs]et(NetworkId|SocketPath) accessors.

    They're not abstracting much as the approach is from a different
    direction. They don't save much typing, either. It saves a few
    lines & saves some module dependencies.
    NadiaYvette committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    4d22bb9 View commit details
    Browse the repository at this point in the history
  9. Remove LoggingLayer case of Store.

    Searching revealed no use cases of the LoggingLayer case. This reduces
    the number of distinct cases needed to remove from the Env DMap.
    NadiaYvette committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    80feb2a View commit details
    Browse the repository at this point in the history
  10. Remove ProtocolParameterMode case from Store

    It largely represents a sort of individual state variable, so the
    corresponding dmap entry in Env is replaced with an additional
    record field. Accessors replace the usage of the case of Store.
    NadiaYvette committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    42c40a5 View commit details
    Browse the repository at this point in the history
  11. Remove BenchTracers case from Store

    A pair of get & set accessors is coupled with a record field in Env
    to replace the usage of the Store case in the Env DMap.
    NadiaYvette committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    359874c View commit details
    Browse the repository at this point in the history
  12. Remove Genesis case of Store

    This adds an Env record field to replace the Genesis DMap entry and
    sweeps uses of the Store case/constructor replacing with accessors.
    NadiaYvette committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    2d49382 View commit details
    Browse the repository at this point in the history
  13. Share Env accessor code

    The Env accessors were duplicating a lot of code, so this just does
    some lambda lifting across the minor differences. The subroutines for
    the shared code are likely worth using to replace the accessors
    outright given an audit of record field names for name clashes &
    renaming for more brevity.
    NadiaYvette committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    f175d16 View commit details
    Browse the repository at this point in the history
  14. Remove Protocol case of Store

    It's replaced with a record field in Env and accessors to get & set it.
    NadiaYvette committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    29db9a0 View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2022

  1. Env hlint warning cleanup

    I inadvertently introduced hlint warnings in this branch by dint of some
    cut & paste of unnecessary $'s. This should hopefully dispose of them,
    but I'll have to find out how to run hlint in the build system to be
    sure.
    NadiaYvette committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    4a7eb72 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8f8991a View commit details
    Browse the repository at this point in the history
  3. Remove SNetworkId case of Store

    This replaces the SNetworkId case of Store with a monomorphic NetworkId
    record field of Env.
    NadiaYvette committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    2fd0d23 View commit details
    Browse the repository at this point in the history
  4. Remove SSocketPath from Store

    This folds the socket's FilePath into a record field of Env.
    NadiaYvette committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    12447bc View commit details
    Browse the repository at this point in the history
  5. Remove KeyName case from Store

    This replaces the KeyName case with a monomorphic Map in Env. Helpers
    are set up to help subsequent wallet & thread patches. Some testing will
    be needed to ensure there's no impact on Aeson's JSON formatting.
    NadiaYvette committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    499e245 View commit details
    Browse the repository at this point in the history
  6. Remove ThreadName from Store

    This removes the ThreadName constructor from Store and replaces it with
    a monomorphic Map in the Env structure and accessors.
    NadiaYvette committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    c883487 View commit details
    Browse the repository at this point in the history
  7. Remove Store altogether

    This removes the use of the WalletName type alias, WalletName
    constructor, and the entire Store module, moving its remainder to
    Script/Types. At the end of this, the use of the Generic DMap is also
    removed altogether in Env. The cabal file is updated to reflect the
    removal of the Store.hs source file.
    NadiaYvette committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    731e16d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a848918 View commit details
    Browse the repository at this point in the history