idris-1.1.0: Functional Programming Language with Dependent Types

CopyrightLicense : BSD3
MaintainerThe Idris Community.
Safe HaskellNone
LanguageHaskell2010

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

Functor Docstring Source # 

Methods

fmap :: (a -> b) -> Docstring a -> Docstring b #

(<$) :: a -> Docstring b -> Docstring a #

Foldable Docstring Source # 

Methods

fold :: 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 #

Traversable Docstring Source # 

Methods

traverse :: 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 # 
Generic (Docstring a) Source # 

Associated Types

type Rep (Docstring a) :: * -> * #

Methods

from :: 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

Functor Block Source # 

Methods

fmap :: (a -> b) -> Block a -> Block b #

(<$) :: a -> Block b -> Block a #

Foldable Block Source # 

Methods

fold :: 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 #

Traversable Block Source # 

Methods

traverse :: 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 # 

Methods

showsPrec :: Int -> Block a -> ShowS #

show :: Block a -> String #

showList :: [Block a] -> ShowS #

Generic (Block a) Source # 

Associated Types

type Rep (Block a) :: * -> * #

Methods

from :: 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

Functor Inline Source # 

Methods

fmap :: (a -> b) -> Inline a -> Inline b #

(<$) :: a -> Inline b -> Inline a #

Foldable Inline Source # 

Methods

fold :: 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 #

Traversable Inline Source # 

Methods

traverse :: 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 # 

Methods

showsPrec :: Int -> Inline a -> ShowS #

show :: Inline a -> String #

showList :: [Inline a] -> ShowS #

Generic (Inline a) Source # 

Associated Types

type Rep (Inline a) :: * -> * #

Methods

from :: Inline a -> Rep (Inline a) x #

to :: Rep (Inline a) x -> Inline a #

type Rep (Inline a) Source # 
type Rep (Inline a)

parseDocstring :: Text -> Docstring () Source #

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

renderDocstring :: (a -> String -> Doc OutputAnnotation) -> Docstring a -> Doc OutputAnnotation Source #

Convert a docstring to be shown by the pretty-printer

emptyDocstring :: Docstring a Source #

The empty docstring

nullDocstring :: Docstring a -> Bool Source #

Check whether a docstring is emtpy

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

Empty documentation for a definition

overview :: Docstring a -> Docstring a Source #

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

containsText :: Text -> Docstring a -> Bool Source #

Does a string occur in the docstring?

annotCode Source #

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

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.