I have something similar to the following
data A = A { id :: Integer , foo :: Maybe String , bar :: Maybe String , baz :: Maybe String }
This data comes to my service as JSON. This request is considered valid only when one or more of foo , bar or baz specified. Is there a better way to express this in a system like Haskell?
Note Unfortunately, I cannot fulfill these individual requests. I just follow a specific protocol.
haskell
Justin wood
source share