idris-1.1.1: Functional Programming Language with Dependent Types

Idris.Docstrings

Description

Synopsis

# Documentation

data Docstring a Source #

Representation of Idris's inline documentation. The type paramter represents the type of terms that are associated with code blocks.

Constructors

 DocString Options (Blocks a)

Instances

 Source # Methodsfmap :: (a -> b) -> Docstring a -> Docstring b #(<$) :: a -> Docstring b -> Docstring a # Source # Methodsfold :: Monoid m => Docstring m -> m #foldMap :: Monoid m => (a -> m) -> Docstring a -> m #foldr :: (a -> b -> b) -> b -> Docstring a -> b #foldr' :: (a -> b -> b) -> b -> Docstring a -> b #foldl :: (b -> a -> b) -> b -> Docstring a -> b #foldl' :: (b -> a -> b) -> b -> Docstring a -> b #foldr1 :: (a -> a -> a) -> Docstring a -> a #foldl1 :: (a -> a -> a) -> Docstring a -> a #toList :: Docstring a -> [a] #null :: Docstring a -> Bool #length :: Docstring a -> Int #elem :: Eq a => a -> Docstring a -> Bool #maximum :: Ord a => Docstring a -> a #minimum :: Ord a => Docstring a -> a #sum :: Num a => Docstring a -> a #product :: Num a => Docstring a -> a # Source # Methodstraverse :: Applicative f => (a -> f b) -> Docstring a -> f (Docstring b) #sequenceA :: Applicative f => Docstring (f a) -> f (Docstring a) #mapM :: Monad m => (a -> m b) -> Docstring a -> m (Docstring b) #sequence :: Monad m => Docstring (m a) -> m (Docstring a) # Show a => Show (Docstring a) Source # MethodsshowsPrec :: Int -> Docstring a -> ShowS #show :: Docstring a -> String #showList :: [Docstring a] -> ShowS # Source # Associated Typestype Rep (Docstring a) :: * -> * # Methodsfrom :: Docstring a -> Rep (Docstring a) x #to :: Rep (Docstring a) x -> Docstring a # type Rep (Docstring a) Source # type Rep (Docstring a) data Block a Source # Block-level elements. Constructors  Para (Inlines a) Header Int (Inlines a) Blockquote (Blocks a) List Bool ListType [Blocks a] CodeBlock CodeAttr Text a HtmlBlock Text HRule Instances  Source # Methodsfmap :: (a -> b) -> Block a -> Block b #(<$) :: a -> Block b -> Block a # Source # Methodsfold :: Monoid m => Block m -> m #foldMap :: Monoid m => (a -> m) -> Block a -> m #foldr :: (a -> b -> b) -> b -> Block a -> b #foldr' :: (a -> b -> b) -> b -> Block a -> b #foldl :: (b -> a -> b) -> b -> Block a -> b #foldl' :: (b -> a -> b) -> b -> Block a -> b #foldr1 :: (a -> a -> a) -> Block a -> a #foldl1 :: (a -> a -> a) -> Block a -> a #toList :: Block a -> [a] #null :: Block a -> Bool #length :: Block a -> Int #elem :: Eq a => a -> Block a -> Bool #maximum :: Ord a => Block a -> a #minimum :: Ord a => Block a -> a #sum :: Num a => Block a -> a #product :: Num a => Block a -> a # Source # Methodstraverse :: Applicative f => (a -> f b) -> Block a -> f (Block b) #sequenceA :: Applicative f => Block (f a) -> f (Block a) #mapM :: Monad m => (a -> m b) -> Block a -> m (Block b) #sequence :: Monad m => Block (m a) -> m (Block a) # Show a => Show (Block a) Source # MethodsshowsPrec :: Int -> Block a -> ShowS #show :: Block a -> String #showList :: [Block a] -> ShowS # Generic (Block a) Source # Associated Typestype Rep (Block a) :: * -> * # Methodsfrom :: Block a -> Rep (Block a) x #to :: Rep (Block a) x -> Block a # type Rep (Block a) Source # type Rep (Block a)

data Inline a Source #

Constructors

 Str Text Space SoftBreak LineBreak Emph (Inlines a) Strong (Inlines a) Code Text a Link (Inlines a) Text Text Image (Inlines a) Text Text Entity Text RawHtml Text

Instances

 Source # Methodsfmap :: (a -> b) -> Inline a -> Inline b #(<\$) :: a -> Inline b -> Inline a # Source # Methodsfold :: Monoid m => Inline m -> m #foldMap :: Monoid m => (a -> m) -> Inline a -> m #foldr :: (a -> b -> b) -> b -> Inline a -> b #foldr' :: (a -> b -> b) -> b -> Inline a -> b #foldl :: (b -> a -> b) -> b -> Inline a -> b #foldl' :: (b -> a -> b) -> b -> Inline a -> b #foldr1 :: (a -> a -> a) -> Inline a -> a #foldl1 :: (a -> a -> a) -> Inline a -> a #toList :: Inline a -> [a] #null :: Inline a -> Bool #length :: Inline a -> Int #elem :: Eq a => a -> Inline a -> Bool #maximum :: Ord a => Inline a -> a #minimum :: Ord a => Inline a -> a #sum :: Num a => Inline a -> a #product :: Num a => Inline a -> a # Source # Methodstraverse :: Applicative f => (a -> f b) -> Inline a -> f (Inline b) #sequenceA :: Applicative f => Inline (f a) -> f (Inline a) #mapM :: Monad m => (a -> m b) -> Inline a -> m (Inline b) #sequence :: Monad m => Inline (m a) -> m (Inline a) # Show a => Show (Inline a) Source # MethodsshowsPrec :: Int -> Inline a -> ShowS #show :: Inline a -> String #showList :: [Inline a] -> ShowS # Source # Associated Typestype Rep (Inline a) :: * -> * # Methodsfrom :: Inline a -> Rep (Inline a) x #to :: Rep (Inline a) x -> Inline a # type Rep (Inline a) Source # type Rep (Inline a)

Construct a docstring from a Text that contains Markdown-formatted docs

Convert a docstring to be shown by the pretty-printer

The empty docstring

Check whether a docstring is emtpy

noDocs :: (Docstring a, [(Name, Docstring a)]) Source #

Empty documentation for a definition

Construct a docstring consisting of the first block-level element of the argument docstring, for use in summaries.

Does a string occur in the docstring?

Arguments

 :: (String -> b) How to annotate code samples -> Docstring a -> Docstring b

Annotate the code samples in a docstring

data DocTerm Source #

The various kinds of code samples that can be embedded in docs

Constructors

 Unchecked Checked Term Example Term Failing Err

Instances

 Source # MethodsshowList :: [DocTerm] -> ShowS # Source # Associated Typestype Rep DocTerm :: * -> * # Methodsto :: Rep DocTerm x -> DocTerm # type Rep DocTerm Source # type Rep DocTerm = D1 (MetaData "DocTerm" "Idris.Docstrings" "idris-1.1.1-EiPUGWBcd2WFkzlZ4X8MYH" False) ((:+:) ((:+:) (C1 (MetaCons "Unchecked" PrefixI False) U1) (C1 (MetaCons "Checked" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Term)))) ((:+:) (C1 (MetaCons "Example" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Term))) (C1 (MetaCons "Failing" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Err)))))

renderDocTerm :: (Term -> Doc OutputAnnotation) -> (Term -> Term) -> DocTerm -> String -> Doc OutputAnnotation Source #

Render a term in the documentation

checkDocstring :: forall a b. (String -> [String] -> String -> a -> b) -> Docstring a -> Docstring b Source #

Run some kind of processing step over code in a Docstring. The code processor gets the language and annotations as parameters, along with the source and the original annotation.