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

firestore: _vNullValue :: Maybe ValueNullValue is Nothing for nulls #170

Open
valyagolev opened this issue Sep 1, 2021 · 0 comments
Open

Comments

@valyagolev
Copy link

In firestore's Value', _vNullValue :: Maybe ValueNullValue is Nothing if the field is null. For the fields that exist in the firestore database, the value from gogol looks like this:

Value' {_vGeoPointValue = Nothing, _vBytesValue = Nothing, _vIntegerValue = Nothing, _vTimestampValue = Nothing, _vDoubleValue = Nothing, _vStringValue = Nothing, _vBooleanValue = Nothing, _vMapValue = Nothing, _vArrayValue = Nothing, _vReferenceValue = Nothing, _vNullValue = Nothing}.

The meaning of all those fields of Value' is apparently "exclusively valued as...". First of all, perhaps a sum type would actually work better here than having a subfield for every variant of the type?

But even if this approach is kept, since data ValueNullValue = NullValue has a constructor, I think it'd be more semantically coherent to have _vNullValue = Just NullValue in case the firestore value is null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant