subscribeImpl :: ForeignPtr SessionImpl
              -> [Subscription]
              -> Maybe (ForeignPtr IdentityImpl)
              -> IO ()
subscribeImpl session subList idPtr =
  withForeignPtr session $ \s -> do
    subListImplF <- populateSubscriptionListImpl subList
    withForeignPtr subListImplF $ \sl -> do
      rc <- case idPtr of
        Just idenPtr ->
          withForeignPtr idenPtr $ \iden ->
           blpapi_Session_subscribe s sl iden nullPtr 0
        Nothing ->
           blpapi_Session_subscribe s sl nullPtr nullPtr 0
      failIfBadErrorCode rc
subscribeImpl :: ForeignPtr SessionImpl
              -> [Subscription]
              -> Maybe (ForeignPtr IdentityImpl)
              -> IO ()
subscribeImpl session subList idPtr =
  withForeignPtr session $ \s -> do
    subListImplF <- populateSubscriptionListImpl subList
    withForeignPtr subListImplF $ \sl -> do
      rc <- case idPtr of
        Just idenPtr ->
          withForeignPtr idenPtr $ \iden ->
           blpapi_Session_subscribe s sl iden nullPtr 0
        Nothing ->
           blpapi_Session_subscribe s sl nullPtr nullPtr 0
      failIfBadErrorCode rc
subscribeImpl session subList idPtr =
  withForeignPtr session $ \s -> do
    subListImplF <- populateSubscriptionListImpl subList
    withForeignPtr subListImplF $ \sl -> do
      rc <- case idPtr of
        Just idenPtr ->
          withForeignPtr idenPtr $ \iden ->
           blpapi_Session_subscribe s sl iden nullPtr 0
        Nothing ->
           blpapi_Session_subscribe s sl nullPtr nullPtr 0
      failIfBadErrorCode rc