Copyright | (c) Adam Conner-Sax 2019 |
---|---|
License | BSD-3-Clause |
Maintainer | adam_conner_sax@yahoo.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
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
- data Docs a m r
- newDoc :: Member (Docs a) effs => Text -> a -> Sem effs ()
- toNamedDocList :: Sem (Docs a ': effs) () -> Sem effs [NamedDoc a]
- toNamedDocListWith :: (a -> b) -> Sem (Docs a ': effs) () -> Sem effs [NamedDoc b]
- toNamedDocListWithM :: (a -> Sem effs b) -> Sem (Docs a ': effs) () -> Sem effs [NamedDoc b]
- data NamedDoc a = NamedDoc {}
- mapNamedDocs :: Monad m => (a -> b) -> m [NamedDoc a] -> m [NamedDoc b]
- mapNamedDocsM :: Monad m => (a -> m b) -> m [NamedDoc a] -> m [NamedDoc b]
Effect
Actions
newDoc :: Member (Docs a) effs => Text -> a -> Sem effs () Source #
Action of the Docs
Effect. Store a named document.
Interpretations
toNamedDocListWith :: (a -> b) -> Sem (Docs a ': effs) () -> Sem 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 :: (a -> Sem effs b) -> Sem (Docs a ': effs) () -> Sem 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 type to hold one named document of type a
.
Instances
Functor NamedDoc Source # | |
Foldable NamedDoc Source # | |
Defined in Knit.Effect.Docs 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 # elem :: Eq a => a -> NamedDoc a -> Bool # maximum :: Ord a => NamedDoc a -> a # minimum :: Ord a => NamedDoc a -> a # | |
Traversable NamedDoc Source # | |