Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fs-storage
implemented trait for conflict resolution #26fs-storage
implemented trait for conflict resolution #26Changes from all commits
cd440c7
ea6eea3
5f8fd37
76d020b
3e1de4d
e5a6ad2
17102b8
ea7625e
7edd370
0b7cf48
6030661
4f78996
25ca04a
6be4222
bd0c358
cd40f49
2d8b3fa
b380243
13c2d5d
5831a70
67ae978
46c169a
ee32675
44f015d
5cf25df
4d4b9b4
28edd18
8ead298
3b03e9a
ae2b721
f442b06
ace00ed
50b3697
5faa5a3
5ffc52f
0d59b3c
6575633
744bf5b
578fa8c
311a75e
196db67
ccb6c9b
3fc03cf
bf6fe2c
68082cd
108f23e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need
neutral
?Could we simply require types to implement
Default
directly inFileStorage
? Is there any practical difference?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same doubt
cc @twitu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no practical difference as such. It's just that Monoid is defined as having a combine and an empty operator. This is consistent across all language implementations (for e.g. haskell). It's better to be consistent with the definition of a monoid. Otherwise, it might be better to call it something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep,
neutral
is from standard Monoid definitions. It's coming from algebra, where it is defined over some operation+
together with some setX
. Pair (+
,X
) must possess 2 properties to be considered a Monoid:X
contains aneutral
element, i.e. such0
that0 + a = a + 0 = 0
for anya
.+
is associative, i.e.a + (b + c)
is same as(a + b) + c
.It's the simplest and the easiest to use algebra abstraction :) It helps to define something what can be summed. E.g. strings, vectors, sets, etc. Defining it as a trait helps to build merge pattern, abstract from particular data.
So, we'll be able to use our storage on top of: