- putting the NodeCache behind an IORef had been chose because those
could've been read non-blocking
- the same is true for TVars. The performance characteristics are likely
worse, but at the advantage of composability within STM monads
- for allowing concurrent access to predecessors and successors, the
whole LocalNodeState is passed wrapped into an STM TVar
- this allows keeping the tests for the mostly pure data type, compared
to protecting only the successor and predecessor list
contributes to #28
Motivation: Including the number of parts in each message part requires
the total number of parts to be known in advance, making dynamic
responses based on the received data difficult
- implement sending of initial join request sending, response parsing
and cache population (untested but compiles)
- refactor basic types and their functions into Hash2Pub.FediChordTypes
to prevent import loops, leaving Hash2Pub.FediChord to contain the
high level actions called from Main
Introduce some code formatting guidelines and enforce them with hlint and stylish:
- End-of-line extra spaces removal;
- Import lines ordering;
- Redundant ($) removal;
- Generalisation of (++) and map to (<>) and fmap;
- Preferring pure over return;
- Removing extraenous extensions.
This commit brings in an HLint configuration file
and several recommended modifications such as:
* End-of-line extra spaces removal;
* Import lines ordering;
* Redundant $ removal;
* Generalisation of ++ and map to <> and fmap;
* Preferring `pure` over `return`;
* Removing extraenous extensions.
And finally, a `stylish-haskell` helper script
that detects if code files are dirty. Can be useful for CI,
although manually calling it can be nice if you would rather
first implement then beautify.