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


-- | Streaming parser/renderer for the OPML 2.0 format.
--   
--   This library implements the OPML 2.0 standard
--   (<a>http://dev.opml.org/spec2.html</a>) as a <a>conduit</a>
--   parser/renderer.
@package opml-conduit
@version 0.6.0.4


-- | OPML is an XML format for outlines.
--   
--   Example:
--   
--   <pre>
--   &lt;opml version="2.0"&gt;
--     &lt;head&gt;
--       &lt;title&gt;OPML title&lt;/title&gt;
--       &lt;dateCreated&gt;Mon, 31 Oct 2005 19:23:00 GMT&lt;/dateCreated&gt;
--     &lt;/head&gt;
--     &lt;body&gt;
--       &lt;outline text="Outline 1" created="Mon, 31 Oct 2005 18:21:33 GMT"/&gt;
--       &lt;outline text="Outline 2" created="Mon, 31 Oct 2005 18:21:33 GMT"/&gt;
--     &lt;/body&gt;
--   &lt;/opml&gt;
--   </pre>
module Text.OPML.Types
data Opml
Opml :: Version -> OpmlHead -> Forest OpmlOutline -> Opml
[opmlVersion] :: Opml -> Version
[opmlHead] :: Opml -> OpmlHead
[opmlOutlines] :: Opml -> Forest OpmlOutline

-- | Bare <a>Opml</a>. Version is set to <tt>2.0</tt>.
mkOpml :: Opml
data OpmlHead
OpmlHead :: Text -> Maybe UTCTime -> Maybe UTCTime -> Text -> Text -> Maybe URI -> Maybe URI -> [Int] -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> OpmlHead
[opmlTitle] :: OpmlHead -> Text
[opmlCreated] :: OpmlHead -> Maybe UTCTime
[modified] :: OpmlHead -> Maybe UTCTime
[ownerName] :: OpmlHead -> Text
[ownerEmail] :: OpmlHead -> Text
[ownerId] :: OpmlHead -> Maybe URI
[docs] :: OpmlHead -> Maybe URI
[expansionState] :: OpmlHead -> [Int]
[vertScrollState] :: OpmlHead -> Maybe Int
[windowBottom] :: OpmlHead -> Maybe Int
[windowLeft] :: OpmlHead -> Maybe Int
[windowRight] :: OpmlHead -> Maybe Int
[windowTop] :: OpmlHead -> Maybe Int

-- | Bare <a>OpmlHead</a>, all fields are set to <a>mempty</a>.
mkOpmlHead :: OpmlHead

-- | Outlines are the main payload of an OPML document.
data OpmlOutline
OpmlOutlineGeneric :: OutlineBase -> Text -> OpmlOutline
OpmlOutlineLink :: OutlineBase -> URI -> OpmlOutline
OpmlOutlineSubscription :: OutlineBase -> OutlineSubscription -> OpmlOutline
data OutlineBase
OutlineBase :: NonNull Text -> Maybe Bool -> Maybe Bool -> Maybe UTCTime -> [NonEmpty (NonNull Text)] -> OutlineBase
[text] :: OutlineBase -> NonNull Text
[isComment] :: OutlineBase -> Maybe Bool
[isBreakpoint] :: OutlineBase -> Maybe Bool
[outlineCreated] :: OutlineBase -> Maybe UTCTime

[categories] :: OutlineBase -> [NonEmpty (NonNull Text)]

-- | Smart constructor for <a>OutlineBase</a>.
mkOutlineBase :: NonNull Text -> OutlineBase
data OutlineSubscription
OutlineSubscription :: URI -> Maybe URI -> Text -> Text -> Text -> Text -> OutlineSubscription
[xmlUri] :: OutlineSubscription -> URI
[htmlUri] :: OutlineSubscription -> Maybe URI
[description] :: OutlineSubscription -> Text
[language] :: OutlineSubscription -> Text
[subscriptionTitle] :: OutlineSubscription -> Text
[subscriptionVersion] :: OutlineSubscription -> Text

-- | Smart constructor for <a>OutlineSubscription</a>
mkOutlineSubscription :: URI -> OutlineSubscription
instance GHC.Classes.Eq Text.OPML.Types.OpmlHead
instance GHC.Generics.Generic Text.OPML.Types.OpmlHead
instance GHC.Show.Show Text.OPML.Types.OpmlHead
instance GHC.Classes.Eq Text.OPML.Types.OutlineBase
instance GHC.Generics.Generic Text.OPML.Types.OutlineBase
instance GHC.Show.Show Text.OPML.Types.OutlineBase
instance GHC.Classes.Eq Text.OPML.Types.OutlineSubscription
instance GHC.Generics.Generic Text.OPML.Types.OutlineSubscription
instance GHC.Show.Show Text.OPML.Types.OutlineSubscription
instance GHC.Classes.Eq Text.OPML.Types.OpmlOutline
instance GHC.Generics.Generic Text.OPML.Types.OpmlOutline
instance GHC.Show.Show Text.OPML.Types.OpmlOutline
instance GHC.Classes.Eq Text.OPML.Types.Opml
instance GHC.Generics.Generic Text.OPML.Types.Opml
instance GHC.Show.Show Text.OPML.Types.Opml

module Text.OPML.Lens
opmlVersionL :: Functor f => Version -> f Version -> Opml -> f Opml
opmlHeadL :: Functor f => OpmlHead -> f OpmlHead -> Opml -> f Opml
opmlOutlinesL :: Functor f => Forest OpmlOutline -> f Forest OpmlOutline -> Opml -> f Opml
opmlTitleL :: Functor f => Text -> f Text -> OpmlHead -> f OpmlHead
opmlCreatedL :: Functor f => Maybe UTCTime -> f Maybe UTCTime -> OpmlHead -> f OpmlHead
modifiedL :: Functor f => Maybe UTCTime -> f Maybe UTCTime -> OpmlHead -> f OpmlHead
ownerNameL :: Functor f => Text -> f Text -> OpmlHead -> f OpmlHead
ownerEmailL :: Functor f => Text -> f Text -> OpmlHead -> f OpmlHead
ownerIdL :: Functor f => Maybe URI -> f Maybe URI -> OpmlHead -> f OpmlHead
docsL :: Functor f => Maybe URI -> f Maybe URI -> OpmlHead -> f OpmlHead
vertScrollStateL :: Functor f => Maybe Int -> f Maybe Int -> OpmlHead -> f OpmlHead
windowBottomL :: Functor f => Maybe Int -> f Maybe Int -> OpmlHead -> f OpmlHead
windowLeftL :: Functor f => Maybe Int -> f Maybe Int -> OpmlHead -> f OpmlHead
windowRightL :: Functor f => Maybe Int -> f Maybe Int -> OpmlHead -> f OpmlHead
windowTopL :: Functor f => Maybe Int -> f Maybe Int -> OpmlHead -> f OpmlHead
expansionStateL :: Traversal' OpmlHead Int
xmlUriL :: Functor f => URI -> f URI -> OutlineSubscription -> f OutlineSubscription
htmlUriL :: Functor f => Maybe URI -> f Maybe URI -> OutlineSubscription -> f OutlineSubscription
descriptionL :: Functor f => Text -> f Text -> OutlineSubscription -> f OutlineSubscription
languageL :: Functor f => Text -> f Text -> OutlineSubscription -> f OutlineSubscription
subscriptionTitleL :: Functor f => Text -> f Text -> OutlineSubscription -> f OutlineSubscription
subscriptionVersionL :: Functor f => Text -> f Text -> OutlineSubscription -> f OutlineSubscription
textL :: Functor f => NonNull Text -> f NonNull Text -> OutlineBase -> f OutlineBase
isCommentL :: Functor f => Maybe Bool -> f Maybe Bool -> OutlineBase -> f OutlineBase
isBreakpointL :: Functor f => Maybe Bool -> f Maybe Bool -> OutlineBase -> f OutlineBase
outlineCreatedL :: Functor f => Maybe UTCTime -> f Maybe UTCTime -> OutlineBase -> f OutlineBase
categoriesL :: Functor f => [NonEmpty NonNull Text] -> f [NonEmpty NonNull Text] -> OutlineBase -> f OutlineBase
_OpmlOutlineGeneric :: Applicative f => (OutlineBase, Text) -> f (OutlineBase, Text) -> OpmlOutline -> f OpmlOutline
_OpmlOutlineLink :: Applicative f => (OutlineBase, URI) -> f (OutlineBase, URI) -> OpmlOutline -> f OpmlOutline
_OpmlOutlineSubscription :: Applicative f => (OutlineBase, OutlineSubscription) -> f (OutlineBase, OutlineSubscription) -> OpmlOutline -> f OpmlOutline


-- | Streaming renderer for the OPML 2.0 standard.
module Text.OPML.Conduit.Render

-- | Render the <tt>&lt;head&gt;</tt> section.
renderOpmlHead :: (Monad m) => OpmlHead -> Source m Event

-- | Render an <tt>&lt;outline&gt;</tt> section.
renderOpmlOutline :: (Monad m) => Tree OpmlOutline -> Source m Event

-- | Render the top-level <tt>&lt;opml&gt;</tt> section.
renderOpml :: (Monad m) => Opml -> Source m Event


-- | Streaming parser for the OPML 2.0 standard.
--   
--   The parser tries to be as lenient as possible. All functions may throw
--   an <a>OpmlException</a>.
module Text.OPML.Conduit.Parse

-- | Parse the top-level <tt>&lt;opml&gt;</tt> element.
parseOpml :: (MonadCatch m) => ConduitM Event o m (Maybe Opml)

-- | Parse the <tt>&lt;head&gt;</tt> section. This function is more lenient
--   than what the standard demands on the following points:
--   
--   <ul>
--   <li>each sub-element may be repeated, in which case only the first
--   occurrence is taken into account;</li>
--   <li>each unknown sub-element is ignored.</li>
--   </ul>
parseOpmlHead :: (MonadCatch m) => ConduitM Event o m (Maybe OpmlHead)

-- | Parse an <tt>&lt;outline&gt;</tt> section. The value of type
--   attributes are not case-sensitive, that is <tt>type="LINK"</tt> has
--   the same meaning as <tt>type="link"</tt>.
parseOpmlOutline :: (MonadCatch m) => ConduitM Event o m (Maybe (Tree OpmlOutline))
data OpmlException
MissingText :: OpmlException
InvalidBool :: Text -> OpmlException
InvalidDecimal :: Text -> OpmlException
InvalidTime :: Text -> OpmlException
InvalidURI :: URIParseError -> OpmlException
InvalidVersion :: Text -> OpmlException
instance GHC.Classes.Eq Text.OPML.Conduit.Parse.OpmlException
instance GHC.Show.Show Text.OPML.Conduit.Parse.OpmlException
instance GHC.Exception.Exception Text.OPML.Conduit.Parse.OpmlException


-- | This module re-exports all the package modules.
module Text.OPML
