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:
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.
In firestore's
Value'
,_vNullValue :: Maybe ValueNullValue
is Nothing if the field isnull
. For the fields that exist in the firestore database, the value fromgogol
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 isnull
.