mtesseract / nakadi-client

Haskell Client Library for the Nakadi Event Broker
Other
13 stars 9 forks source link

Simplify SubscriptionEventStreamBatch type #112

Open mtesseract opened 6 years ago

mtesseract commented 6 years ago

Currently SubscriptionEventStreamBatch is defined as follows

data SubscriptionEventStreamBatch a = SubscriptionEventStreamBatch
  { _cursor :: SubscriptionCursor -- ^ cursor for this subscription batch
  , _events :: Maybe (Vector a) -- ^ Events for this subscription batch
  } deriving (Show, Generic)

In particular, _events is defined as a Maybe (Vector a). As I see it, we don't need the extra Maybe wrapping at this point. The case "no events field present in Nakadi batch" could be handled just like "empty events array in Nakadi batch".