knit-haskell-0.1.0.0: a minimal Rmarkdown sort-of-thing for haskell, by way of Pandoc

Copyright(c) Adam Conner-Sax 2019
LicenseBSD-3-Clause
Maintaineradam_conner_sax@yahoo.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Knit.Effect.Docs

Contents

Description

Polysemy effect used by knit-haskell when one code-base is used to create multiple docs. Each can be created and then stored in the list maintained by this effect. Then, when the effects are "run", this list can be processed to produce the required output.

Synopsis

Effect

data Docs a m r Source #

GADT to represent storing a named document.

Actions

newDoc :: Member (Docs a) effs => Text -> a -> Semantic effs () Source #

Action of the Docs Effect. Store a named document.

Interpretations

toNamedDocList :: Typeable a => Semantic (Docs a ': effs) () -> Semantic effs [NamedDoc a] Source #

Interpret Docs (via Writer), producing a list of NamedDoc a

toNamedDocListWith :: Typeable a => (a -> b) -> Semantic (Docs a ': effs) () -> Semantic effs [NamedDoc b] Source #

Combine the interpretation and mapping step. Commonly used to "run" the effect and map the results to your deisred output format.

toNamedDocListWithM :: Typeable a => (a -> Semantic effs b) -> Semantic (Docs a ': effs) () -> Semantic effs [NamedDoc b] Source #

Combine the interpretation and effectful mapping step. Commonly used to "run" the effect and map the results to your deisred output format.

Helper Types

data NamedDoc a Source #

Data type to hold one named document of type a.

Constructors

NamedDoc 

Fields

Instances
Functor NamedDoc Source # 
Instance details

Defined in Knit.Effect.Docs

Methods

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

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

Foldable NamedDoc Source # 
Instance details

Defined in Knit.Effect.Docs

Methods

fold :: Monoid m => NamedDoc m -> m #

foldMap :: Monoid m => (a -> m) -> NamedDoc a -> m #

foldr :: (a -> b -> b) -> b -> NamedDoc a -> b #

foldr' :: (a -> b -> b) -> b -> NamedDoc a -> b #

foldl :: (b -> a -> b) -> b -> NamedDoc a -> b #

foldl' :: (b -> a -> b) -> b -> NamedDoc a -> b #

foldr1 :: (a -> a -> a) -> NamedDoc a -> a #

foldl1 :: (a -> a -> a) -> NamedDoc a -> a #

toList :: NamedDoc a -> [a] #

null :: NamedDoc a -> Bool #

length :: NamedDoc a -> Int #

elem :: Eq a => a -> NamedDoc a -> Bool #

maximum :: Ord a => NamedDoc a -> a #

minimum :: Ord a => NamedDoc a -> a #

sum :: Num a => NamedDoc a -> a #

product :: Num a => NamedDoc a -> a #

Traversable NamedDoc Source # 
Instance details

Defined in Knit.Effect.Docs

Methods

traverse :: Applicative f => (a -> f b) -> NamedDoc a -> f (NamedDoc b) #

sequenceA :: Applicative f => NamedDoc (f a) -> f (NamedDoc a) #

mapM :: Monad m => (a -> m b) -> NamedDoc a -> m (NamedDoc b) #

sequence :: Monad m => NamedDoc (m a) -> m (NamedDoc a) #

Helper Functions

mapNamedDocs :: Monad m => (a -> b) -> m [NamedDoc a] -> m [NamedDoc b] Source #

Map over the doc part of Functor m => m [NamedDoc a] with an a->b resulting in m [NamedDoc b]

mapNamedDocsM :: Monad m => (a -> m b) -> m [NamedDoc a] -> m [NamedDoc b] Source #

Map over the doc part of Monad m => m [NamedDoc a] with a -> m b resulting in m [NamedDoc b]