-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Data structure for working with Jupyter notebooks (ipynb).
--   
--   ipynb defines a data structure for representing Jupyter notebooks,
--   along with ToJSON and FromJSON instances for conversion to and from
--   JSON .ipynb files.
@package ipynb
@version 0.2

-- | Data structure and JSON serializers for ipynb (Jupyter notebook)
--   format. Version 4 of the format is documented here:
--   https://nbformat.readthedocs.io/en/latest/format_description.html.
--   
--   The library supports both version 4 ('Notebook NbV4') and version 3
--   ('Notebook NbV3') of nbformat. Note that this is a phantom type: the
--   NbV3 or NbV4 parameter only affects JSON serialization,
--   not the data structure itself. So code that manipulates notebooks can
--   be polymorphic, operating on `Notebook a`.
module Data.Ipynb

-- | A Jupyter notebook.
data Notebook a
Notebook :: JSONMeta -> (Int, Int) -> [Cell a] -> Notebook a
[notebookMetadata] :: Notebook a -> JSONMeta
[notebookFormat] :: Notebook a -> (Int, Int)
[notebookCells] :: Notebook a -> [Cell a]

-- | Indexes Notebook for serialization as nbformat version 3.
data NbV3

-- | Indexes Notebook for serialization as nbformat version 4.
data NbV4
newtype JSONMeta
JSONMeta :: Map Text Value -> JSONMeta

-- | A Jupyter notebook cell.
data Cell a
Cell :: CellType a -> Maybe Text -> Source -> JSONMeta -> Maybe MimeAttachments -> Cell a
[cellType] :: Cell a -> CellType a
[cellId] :: Cell a -> Maybe Text
[cellSource] :: Cell a -> Source
[cellMetadata] :: Cell a -> JSONMeta
[cellAttachments] :: Cell a -> Maybe MimeAttachments

-- | A Source is a textual content which may be represented in JSON
--   either as a single string or as a list of strings (which are
--   concatenated).
newtype Source
Source :: [Text] -> Source
[unSource] :: Source -> [Text]

-- | Information about the type of a notebook cell, plus data specific to
--   that type. note that Heading is for v3 only; a Heading
--   will be rendered as Markdown in v4.
data CellType a
Markdown :: CellType a
Heading :: Int -> CellType a
[headingLevel] :: CellType a -> Int
Raw :: CellType a
Code :: Maybe Int -> [Output a] -> CellType a
[codeExecutionCount] :: CellType a -> Maybe Int
[codeOutputs] :: CellType a -> [Output a]

-- | Output from a Code cell.
data Output a
Stream :: Text -> Source -> Output a
[streamName] :: Output a -> Text
[streamText] :: Output a -> Source
DisplayData :: MimeBundle -> JSONMeta -> Output a
[displayData] :: Output a -> MimeBundle
[displayMetadata] :: Output a -> JSONMeta
ExecuteResult :: Int -> MimeBundle -> JSONMeta -> Output a
[executeCount] :: Output a -> Int
[executeData] :: Output a -> MimeBundle
[executeMetadata] :: Output a -> JSONMeta
Err :: Text -> Text -> [Text] -> Output a
[errName] :: Output a -> Text
[errValue] :: Output a -> Text
[errTraceback] :: Output a -> [Text]
type MimeType = Text

-- | Data in an execution result or display data cell.
data MimeData
BinaryData :: ByteString -> MimeData
TextualData :: Text -> MimeData
JsonData :: Value -> MimeData

-- | A MimeBundle wraps a map from mime types to mime data.
newtype MimeBundle
MimeBundle :: Map MimeType MimeData -> MimeBundle
[unMimeBundle] :: MimeBundle -> Map MimeType MimeData
newtype MimeAttachments
MimeAttachments :: Map Text MimeBundle -> MimeAttachments

-- | Break up a string into a list of strings, each representing one line
--   of the string (including trailing newline if any).
breakLines :: Text -> [Text]
instance GHC.Classes.Eq (Data.Ipynb.Cell a)
instance GHC.Classes.Eq (Data.Ipynb.CellType a)
instance GHC.Classes.Eq Data.Ipynb.JSONMeta
instance GHC.Classes.Eq Data.Ipynb.MimeAttachments
instance GHC.Classes.Eq Data.Ipynb.MimeBundle
instance GHC.Classes.Eq Data.Ipynb.MimeData
instance GHC.Classes.Eq (Data.Ipynb.Notebook a)
instance GHC.Classes.Eq (Data.Ipynb.Output a)
instance GHC.Classes.Eq Data.Ipynb.Source
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Ipynb.Cell Data.Ipynb.NbV4)
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Ipynb.Cell Data.Ipynb.NbV3)
instance Data.Aeson.Types.FromJSON.FromJSON Data.Ipynb.JSONMeta
instance Data.Aeson.Types.FromJSON.FromJSON Data.Ipynb.MimeAttachments
instance Data.Aeson.Types.FromJSON.FromJSON Data.Ipynb.MimeBundle
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Ipynb.Notebook Data.Ipynb.NbV4)
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Ipynb.Notebook Data.Ipynb.NbV3)
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Ipynb.Output Data.Ipynb.NbV4)
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Ipynb.Output Data.Ipynb.NbV3)
instance Data.Aeson.Types.FromJSON.FromJSON Data.Ipynb.Source
instance GHC.Internal.Generics.Generic (Data.Ipynb.Cell a)
instance GHC.Internal.Generics.Generic (Data.Ipynb.CellType a)
instance GHC.Internal.Generics.Generic Data.Ipynb.JSONMeta
instance GHC.Internal.Generics.Generic Data.Ipynb.MimeAttachments
instance GHC.Internal.Generics.Generic Data.Ipynb.MimeBundle
instance GHC.Internal.Generics.Generic Data.Ipynb.MimeData
instance GHC.Internal.Generics.Generic (Data.Ipynb.Notebook a)
instance GHC.Internal.Generics.Generic (Data.Ipynb.Output a)
instance GHC.Internal.Generics.Generic Data.Ipynb.Source
instance GHC.Internal.Base.Monoid Data.Ipynb.JSONMeta
instance GHC.Internal.Base.Monoid Data.Ipynb.MimeAttachments
instance GHC.Internal.Base.Monoid Data.Ipynb.MimeBundle
instance GHC.Internal.Base.Monoid (Data.Ipynb.Notebook a)
instance GHC.Internal.Base.Monoid Data.Ipynb.Source
instance GHC.Classes.Ord Data.Ipynb.JSONMeta
instance GHC.Classes.Ord Data.Ipynb.MimeAttachments
instance GHC.Classes.Ord Data.Ipynb.MimeBundle
instance GHC.Classes.Ord Data.Ipynb.MimeData
instance GHC.Internal.Base.Semigroup Data.Ipynb.JSONMeta
instance GHC.Internal.Base.Semigroup Data.Ipynb.MimeAttachments
instance GHC.Internal.Base.Semigroup Data.Ipynb.MimeBundle
instance GHC.Internal.Base.Semigroup (Data.Ipynb.Notebook a)
instance GHC.Internal.Base.Semigroup Data.Ipynb.Source
instance GHC.Internal.Show.Show (Data.Ipynb.Cell a)
instance GHC.Internal.Show.Show (Data.Ipynb.CellType a)
instance GHC.Internal.Show.Show Data.Ipynb.JSONMeta
instance GHC.Internal.Show.Show Data.Ipynb.MimeAttachments
instance GHC.Internal.Show.Show Data.Ipynb.MimeBundle
instance GHC.Internal.Show.Show Data.Ipynb.MimeData
instance GHC.Internal.Show.Show (Data.Ipynb.Notebook a)
instance GHC.Internal.Show.Show (Data.Ipynb.Output a)
instance GHC.Internal.Show.Show Data.Ipynb.Source
instance Data.Aeson.Types.ToJSON.ToJSON (Data.Ipynb.Cell Data.Ipynb.NbV4)
instance Data.Aeson.Types.ToJSON.ToJSON (Data.Ipynb.Cell Data.Ipynb.NbV3)
instance Data.Aeson.Types.ToJSON.ToJSON Data.Ipynb.JSONMeta
instance Data.Aeson.Types.ToJSON.ToJSON Data.Ipynb.MimeAttachments
instance Data.Aeson.Types.ToJSON.ToJSON Data.Ipynb.MimeBundle
instance Data.Aeson.Types.ToJSON.ToJSON Data.Ipynb.MimeData
instance Data.Aeson.Types.ToJSON.ToJSON (Data.Ipynb.Notebook Data.Ipynb.NbV4)
instance Data.Aeson.Types.ToJSON.ToJSON (Data.Ipynb.Notebook Data.Ipynb.NbV3)
instance Data.Aeson.Types.ToJSON.ToJSON (Data.Ipynb.Output Data.Ipynb.NbV4)
instance Data.Aeson.Types.ToJSON.ToJSON (Data.Ipynb.Output Data.Ipynb.NbV3)
instance Data.Aeson.Types.ToJSON.ToJSON Data.Ipynb.Source
