Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type Nat = Word64
- type SSyntaxText = SyntaxText' Reference
- type Doc = DocG RenderedSpecialForm
- type EvaluatedDoc v = DocG (EvaluatedSpecialForm v)
- type SrcRefs = Ref (UnisonHash, DisplayObject SyntaxText Src)
- data DocG specialForm
- = Word Text
- | Code (DocG specialForm)
- | CodeBlock Text (DocG specialForm)
- | Bold (DocG specialForm)
- | Italic (DocG specialForm)
- | Strikethrough (DocG specialForm)
- | Style Text (DocG specialForm)
- | Anchor Text (DocG specialForm)
- | Blockquote (DocG specialForm)
- | Blankline
- | Linebreak
- | SectionBreak
- | Tooltip (DocG specialForm) (DocG specialForm)
- | Aside (DocG specialForm)
- | Callout (Maybe (DocG specialForm)) (DocG specialForm)
- | Table [[DocG specialForm]]
- | Folded Bool (DocG specialForm) (DocG specialForm)
- | Paragraph [DocG specialForm]
- | BulletedList [DocG specialForm]
- | NumberedList Nat [DocG specialForm]
- | Section (DocG specialForm) [DocG specialForm]
- | NamedLink (DocG specialForm) (DocG specialForm)
- | Image (DocG specialForm) (DocG specialForm) (Maybe (DocG specialForm))
- | Special specialForm
- | Join [DocG specialForm]
- | UntitledSection [DocG specialForm]
- | Column [DocG specialForm]
- | Group (DocG specialForm)
- type UnisonHash = Text
- data Ref a
- data MediaSource = MediaSource {}
- data RenderedSpecialForm
- = Source [SrcRefs]
- | FoldedSource [SrcRefs]
- | Example SyntaxText
- | ExampleBlock SyntaxText
- | Link SyntaxText
- | Signature [SyntaxText]
- | SignatureInline SyntaxText
- | Eval SyntaxText SyntaxText
- | EvalInline SyntaxText SyntaxText
- | Embed SyntaxText
- | EmbedInline SyntaxText
- | Video [MediaSource] (Map Text Text)
- | FrontMatter (Map Text [Text])
- | LaTeXInline Text
- | Svg Text
- | RenderError (RenderError SyntaxText)
- data EvaluatedSpecialForm v
- = ESource [EvaluatedSrc v]
- | EFoldedSource [EvaluatedSrc v]
- | EExample (Term v ())
- | EExampleBlock (Term v ())
- | ELink (Either (Term v ()) LabeledDependency)
- | ESignature [(Referent, Type v ())]
- | ESignatureInline (Referent, Type v ())
- | EEval (Term v ()) (Maybe (Term v ()))
- | EEvalInline (Term v ()) (Maybe (Term v ()))
- | EEmbed (Term v ())
- | EEmbedInline (Term v ())
- | EVideo [MediaSource] (Map Text Text)
- | EFrontMatter (Map Text [Text])
- | ELaTeXInline Text
- | ESvg Text
- | ERenderError (RenderError (Term v ()))
- data Src = Src SyntaxText SyntaxText
- evalAndRenderDoc :: forall v m. (Var v, Monad m) => PrettyPrintEnvDecl -> (Reference -> m (Maybe (Term v ()))) -> (Referent -> m (Maybe (Type v ()))) -> (Term v () -> m (Maybe (Term v ()))) -> (Reference -> m (Maybe (Decl v ()))) -> Term v () -> m Doc
- renderDoc :: forall v. Var v => PrettyPrintEnvDecl -> EvaluatedDoc v -> Doc
- evalDoc :: forall v m. (Var v, Monad m) => (Reference -> m (Maybe (Term v ()))) -> (Referent -> m (Maybe (Type v ()))) -> (Term v () -> m (Maybe (Term v ()))) -> (Reference -> m (Maybe (Decl v ()))) -> Term v () -> m (EvaluatedDoc v)
- data RenderError trm = InvalidTerm trm
- data EvaluatedSrc v
- data EvaluatedDecl v
- = MissingDecl Reference
- | BuiltinDecl Reference
- | FoundDecl Reference (Decl v ())
- data EvaluatedTerm v
- = MissingTerm Reference
- | BuiltinTypeSig Reference (Type v ())
- | MissingBuiltinTypeSig Reference
- | FoundTerm Reference (Type v ()) (Term v ())
- dependencies :: Ord v => EvaluatedDoc v -> Set LabeledDependency
- dependenciesSpecial :: forall v. Ord v => EvaluatedSpecialForm v -> Set LabeledDependency
Documentation
type SSyntaxText = SyntaxText' Reference Source #
type Doc = DocG RenderedSpecialForm Source #
A doc rendered down to SyntaxText.
type EvaluatedDoc v = DocG (EvaluatedSpecialForm v) Source #
A doc which has been evaluated and includes all information necessary to be rendered.
type SrcRefs = Ref (UnisonHash, DisplayObject SyntaxText Src) Source #
data DocG specialForm Source #
A doc parameterized by its special forms.
Word Text | |
Code (DocG specialForm) | |
CodeBlock Text (DocG specialForm) | |
Bold (DocG specialForm) | |
Italic (DocG specialForm) | |
Strikethrough (DocG specialForm) | |
Style Text (DocG specialForm) | |
Anchor Text (DocG specialForm) | |
Blockquote (DocG specialForm) | |
Blankline | |
Linebreak | |
SectionBreak | |
Tooltip (DocG specialForm) (DocG specialForm) | |
Aside (DocG specialForm) | |
Callout (Maybe (DocG specialForm)) (DocG specialForm) | |
Table [[DocG specialForm]] | |
Folded Bool (DocG specialForm) (DocG specialForm) | |
Paragraph [DocG specialForm] | |
BulletedList [DocG specialForm] | |
NumberedList Nat [DocG specialForm] | |
Section (DocG specialForm) [DocG specialForm] | |
NamedLink (DocG specialForm) (DocG specialForm) | |
Image (DocG specialForm) (DocG specialForm) (Maybe (DocG specialForm)) | |
Special specialForm | |
Join [DocG specialForm] | |
UntitledSection [DocG specialForm] | |
Column [DocG specialForm] | |
Group (DocG specialForm) |
Instances
type UnisonHash = Text Source #
Instances
data MediaSource Source #
Instances
data RenderedSpecialForm Source #
Instances
data EvaluatedSpecialForm v Source #
ESource [EvaluatedSrc v] | |
EFoldedSource [EvaluatedSrc v] | |
EExample (Term v ()) | |
EExampleBlock (Term v ()) | |
ELink (Either (Term v ()) LabeledDependency) | |
ESignature [(Referent, Type v ())] | |
ESignatureInline (Referent, Type v ()) | |
EEval (Term v ()) (Maybe (Term v ())) | |
EEvalInline (Term v ()) (Maybe (Term v ())) | |
EEmbed (Term v ()) | |
EEmbedInline (Term v ()) | |
EVideo [MediaSource] (Map Text Text) | |
EFrontMatter (Map Text [Text]) | |
ELaTeXInline Text | |
ESvg Text | |
ERenderError (RenderError (Term v ())) |
Instances
Instances
ToJSON Src Source # | |
Defined in Unison.Server.Doc | |
Generic Src Source # | |
Show Src Source # | |
Eq Src Source # | |
Ord Src Source # | |
ToSchema Src Source # | |
Defined in Unison.Server.Doc | |
type Rep Src Source # | |
Defined in Unison.Server.Doc type Rep Src = D1 ('MetaData "Src" "Unison.Server.Doc" "unison-share-api-0.0.0-C8EhduMcnIVLJzlEB6yMhH" 'False) (C1 ('MetaCons "Src" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SyntaxText) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SyntaxText))) |
evalAndRenderDoc :: forall v m. (Var v, Monad m) => PrettyPrintEnvDecl -> (Reference -> m (Maybe (Term v ()))) -> (Referent -> m (Maybe (Type v ()))) -> (Term v () -> m (Maybe (Term v ()))) -> (Reference -> m (Maybe (Decl v ()))) -> Term v () -> m Doc Source #
Evaluate the doc, then render it.
renderDoc :: forall v. Var v => PrettyPrintEnvDecl -> EvaluatedDoc v -> Doc Source #
Renders the given doc, which must have been evaluated using evalDoc
evalDoc :: forall v m. (Var v, Monad m) => (Reference -> m (Maybe (Term v ()))) -> (Referent -> m (Maybe (Type v ()))) -> (Term v () -> m (Maybe (Term v ()))) -> (Reference -> m (Maybe (Decl v ()))) -> Term v () -> m (EvaluatedDoc v) Source #
Evaluates the given doc, expanding transclusions, expressions, etc.
data RenderError trm Source #
InvalidTerm trm |
Instances
data EvaluatedSrc v Source #
Instances
data EvaluatedDecl v Source #
Instances
data EvaluatedTerm v Source #
MissingTerm Reference | |
BuiltinTypeSig Reference (Type v ()) | |
MissingBuiltinTypeSig Reference | |
FoundTerm Reference (Type v ()) (Term v ()) |
Instances
dependencies :: Ord v => EvaluatedDoc v -> Set LabeledDependency Source #
dependenciesSpecial :: forall v. Ord v => EvaluatedSpecialForm v -> Set LabeledDependency Source #
Determines all dependencies of a special form