-
Notifications
You must be signed in to change notification settings - Fork 720
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
partially monomorphise & de-generify Env #4521
Commits on Oct 11, 2022
-
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.
Configuration menu - View commit details
-
Copy full SHA for 6f9786c - Browse repository at this point
Copy the full SHA 6f9786cView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 5cbd4a3 - Browse repository at this point
Copy the full SHA 5cbd4a3View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for b1c5479 - Browse repository at this point
Copy the full SHA b1c5479View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for aab193f - Browse repository at this point
Copy the full SHA aab193fView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 8ddfaed - Browse repository at this point
Copy the full SHA 8ddfaedView commit details -
Configuration menu - View commit details
-
Copy full SHA for 64ccd8d - Browse repository at this point
Copy the full SHA 64ccd8dView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for d707426 - Browse repository at this point
Copy the full SHA d707426View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 4d22bb9 - Browse repository at this point
Copy the full SHA 4d22bb9View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 80feb2a - Browse repository at this point
Copy the full SHA 80feb2aView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 42c40a5 - Browse repository at this point
Copy the full SHA 42c40a5View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 359874c - Browse repository at this point
Copy the full SHA 359874cView commit details -
This adds an Env record field to replace the Genesis DMap entry and sweeps uses of the Store case/constructor replacing with accessors.
Configuration menu - View commit details
-
Copy full SHA for 2d49382 - Browse repository at this point
Copy the full SHA 2d49382View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for f175d16 - Browse repository at this point
Copy the full SHA f175d16View commit details -
It's replaced with a record field in Env and accessors to get & set it.
Configuration menu - View commit details
-
Copy full SHA for 29db9a0 - Browse repository at this point
Copy the full SHA 29db9a0View commit details
Commits on Oct 12, 2022
-
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.
Configuration menu - View commit details
-
Copy full SHA for 4a7eb72 - Browse repository at this point
Copy the full SHA 4a7eb72View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f8991a - Browse repository at this point
Copy the full SHA 8f8991aView commit details -
Remove SNetworkId case of Store
This replaces the SNetworkId case of Store with a monomorphic NetworkId record field of Env.
Configuration menu - View commit details
-
Copy full SHA for 2fd0d23 - Browse repository at this point
Copy the full SHA 2fd0d23View commit details -
This folds the socket's FilePath into a record field of Env.
Configuration menu - View commit details
-
Copy full SHA for 12447bc - Browse repository at this point
Copy the full SHA 12447bcView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 499e245 - Browse repository at this point
Copy the full SHA 499e245View commit details -
This removes the ThreadName constructor from Store and replaces it with a monomorphic Map in the Env structure and accessors.
Configuration menu - View commit details
-
Copy full SHA for c883487 - Browse repository at this point
Copy the full SHA c883487View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 731e16d - Browse repository at this point
Copy the full SHA 731e16dView commit details -
Configuration menu - View commit details
-
Copy full SHA for a848918 - Browse repository at this point
Copy the full SHA a848918View commit details