Safe Haskell | None |
---|---|
Language | Haskell2010 |
Control.OutputCapable.Blocks.Type
Description
A version of the Type
module
specialised to Language
.
It provides basically the same interface but specialised to Output
and additionally a somewhat more general SpecialOutput
variant.
Both type synonyms are also provided.
Synopsis
- pattern YesNo :: Bool -> [GenericOutput language element] -> GenericOutput language element
- pattern Image :: FilePath -> GenericOutput language element
- pattern Images :: Map String FilePath -> GenericOutput language element
- pattern Paragraph :: [GenericOutput language element] -> GenericOutput language element
- pattern Enumerated :: [([GenericOutput language element], [GenericOutput language element])] -> GenericOutput language element
- pattern Itemized :: [[GenericOutput language element]] -> GenericOutput language element
- pattern Indented :: [GenericOutput language element] -> GenericOutput language element
- pattern Latex :: String -> GenericOutput language element
- pattern Folded :: Bool -> Map language String -> [GenericOutput language element] -> GenericOutput language element
- pattern Code :: Map language String -> GenericOutput language element
- pattern Translated :: Map language String -> GenericOutput language element
- pattern Special :: element -> GenericOutput language element
- type Output = SpecialOutput ()
- getOutputSequence :: Functor m => LangM (ReportT Output m) -> m [Output]
- getOutputSequenceWithRating :: Functor m => Rated (ReportT Output m) -> m (Maybe Rational, [Output])
- getOutputSequenceWithResult :: Functor m => LangM' (ReportT Output m) a -> m (Maybe a, [Output])
- toOutputCapable :: forall (m :: Type -> Type). OutputCapable m => [Output] -> LangM m
- type SpecialOutput = GenericOutput Language
- checkTranslations :: (element -> [String]) -> SpecialOutput element -> [String]
- foldMapOutputBy :: (a -> a -> a) -> (SpecialOutput element -> a) -> SpecialOutput element -> a
- getSpecialOutputSequence :: Functor m => LangM (ReportT (SpecialOutput element) m) -> m [SpecialOutput element]
- getSpecialOutputSequenceWithRating :: Functor m => Rated (ReportT (SpecialOutput element) m) -> m (Maybe Rational, [SpecialOutput element])
- specialToOutputCapable :: forall (m :: Type -> Type) element. OutputCapable m => (element -> LangM m) -> [SpecialOutput element] -> LangM m
- checkTranslation :: Map Language String -> [String]
common constructors
pattern YesNo :: Bool -> [GenericOutput language element] -> GenericOutput language element Source #
output condition check, but continue afterwards
pattern Image :: FilePath -> GenericOutput language element Source #
a single image
pattern Images :: Map String FilePath -> GenericOutput language element Source #
multiple images with a text tag that is to be printed (e.g. a number)
pattern Paragraph :: [GenericOutput language element] -> GenericOutput language element Source #
to group (and separate) output
pattern Enumerated :: [([GenericOutput language element], [GenericOutput language element])] -> GenericOutput language element Source #
an enumeration with the enumerator first and content second
pattern Itemized :: [[GenericOutput language element]] -> GenericOutput language element Source #
like enumeration (but without enumerator)
pattern Indented :: [GenericOutput language element] -> GenericOutput language element Source #
for indenting output
pattern Latex :: String -> GenericOutput language element Source #
latex code (for formulas and text blocks only)
pattern Folded :: Bool -> Map language String -> [GenericOutput language element] -> GenericOutput language element Source #
minimisable output with default open-state, title and content
pattern Code :: Map language String -> GenericOutput language element Source #
to output as text with fixed width, providing translations
pattern Translated :: Map language String -> GenericOutput language element Source #
normal text with translations
pattern Special :: element -> GenericOutput language element Source #
allows abbreviating several complex parts which have special rendering functions which are not easily representable as ADT
the interface
for Output
type Output = SpecialOutput () Source #
SpecialOutput
without Special
elements
getOutputSequence :: Functor m => LangM (ReportT Output m) -> m [Output] Source #
Converts non graded OutputCapable
value using GenericOutput
into a list of Output
getOutputSequenceWithRating :: Functor m => Rated (ReportT Output m) -> m (Maybe Rational, [Output]) Source #
Converts graded OutputCapable
value using GenericOutput
into a rating and a list of Output
getOutputSequenceWithResult :: Functor m => LangM' (ReportT Output m) a -> m (Maybe a, [Output]) Source #
Converts OutputCapable
value using GenericOutput
into a result and a list of Output
Consider using getOutputSequenceWithRating
in order to get better error messages on implementation errors.
toOutputCapable :: forall (m :: Type -> Type). OutputCapable m => [Output] -> LangM m Source #
Convert a list of Output
into any instance of OutputCapable
for SpecialOutput
type SpecialOutput = GenericOutput Language Source #
GenericOutput
but with translations fixed to Language
checkTranslations :: (element -> [String]) -> SpecialOutput element -> [String] Source #
Checks SpecialOutput
for missing translations.
@since: 0.3.0.1
foldMapOutputBy :: (a -> a -> a) -> (SpecialOutput element -> a) -> SpecialOutput element -> a Source #
A right fold with the possibility to inspect every node.
@since: 0.4
getSpecialOutputSequence :: Functor m => LangM (ReportT (SpecialOutput element) m) -> m [SpecialOutput element] Source #
Converts non graded OutputCapable
value using GenericOutput
into a list of SpecialOutput
getSpecialOutputSequenceWithRating :: Functor m => Rated (ReportT (SpecialOutput element) m) -> m (Maybe Rational, [SpecialOutput element]) Source #
Converts graded OutputCapable
value using GenericOutput
into a rating and a list of SpecialOutput
specialToOutputCapable :: forall (m :: Type -> Type) element. OutputCapable m => (element -> LangM m) -> [SpecialOutput element] -> LangM m Source #
Convert a list of SpecialOutput
into any instance of OutputCapable