accumKernelspecs :: Map Text Kernelspec -- ^ Previously seen kernelspecs
                 -> (Text, Value) -- ^ Kernelspec name and JSON value for it
                 -> Parser (Map Text Kernelspec) -- ^ Map with old kernelspecs and parsed new one
accumKernelspecs prev (name, val) = do
  kernelspec <- parseKernelspec val
  return $ Map.insert name kernelspec prev

-- | Parse a JSON 'Value' into a 'Kernelspec'.
accumKernelspecs :: Map Text Kernelspec -- ^ Previously seen kernelspecs
                 -> (Text, Value) -- ^ Kernelspec name and JSON value for it
                 -> Parser (Map Text Kernelspec)
accumKernelspecs prev (name, val) = do
  kernelspec <- parseKernelspec val
  return $ Map.insert name kernelspec prev

-- | Parse a JSON 'Value' into a 'Kernelspec'.
accumKernelspecs prev (name, val) = do
  kernelspec <- parseKernelspec val
  return $ Map.insert name kernelspec prev

-- | Parse a JSON 'Value' into a 'Kernelspec'.