Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data types and functions for representing a simplified form of PureScript code, intended for use in e.g. HTML documentation.
Synopsis
- data RenderedCodeElement
- asRenderedCodeElement :: Parse Text RenderedCodeElement
- data ContainingModule
- asContainingModule :: Parse Text ContainingModule
- containingModuleToMaybe :: ContainingModule -> Maybe ModuleName
- maybeToContainingModule :: Maybe ModuleName -> ContainingModule
- fromContainingModule :: ModuleName -> ContainingModule -> ModuleName
- fromQualified :: Qualified a -> (ContainingModule, a)
- data Namespace
- data Link
- type FixityAlias = Qualified (Either (ProperName TypeName) (Either Ident (ProperName ConstructorName)))
- data RenderedCode
- asRenderedCode :: Parse Text RenderedCode
- outputWith :: Monoid a => (RenderedCodeElement -> a) -> RenderedCode -> a
- sp :: RenderedCode
- parens :: RenderedCode -> RenderedCode
- syntax :: Text -> RenderedCode
- keyword :: Text -> RenderedCode
- keywordForall :: RenderedCode
- keywordData :: RenderedCode
- keywordNewtype :: RenderedCode
- keywordType :: RenderedCode
- keywordClass :: RenderedCode
- keywordInstance :: RenderedCode
- keywordWhere :: RenderedCode
- keywordFixity :: Associativity -> RenderedCode
- keywordKind :: RenderedCode
- keywordAs :: RenderedCode
- ident :: Qualified Ident -> RenderedCode
- dataCtor :: Qualified (ProperName ConstructorName) -> RenderedCode
- typeCtor :: Qualified (ProperName TypeName) -> RenderedCode
- typeOp :: Qualified (OpName TypeOpName) -> RenderedCode
- typeVar :: Text -> RenderedCode
- kind :: Qualified (ProperName KindName) -> RenderedCode
- alias :: FixityAlias -> RenderedCode
- aliasName :: FixityAlias -> Text -> RenderedCode
Documentation
data RenderedCodeElement Source #
A single element in a rendered code fragment. The intention is to support multiple output formats. For example, plain text, or highlighted HTML.
Syntax Text | |
Keyword Text | |
Space | |
Symbol Namespace Text Link | Any symbol which you might or might not want to link to, in any namespace (value, type, or kind). Note that this is not related to the kind called Symbol for type-level strings. |
Instances
data ContainingModule Source #
This type is isomorphic to Maybe
ModuleName
. It makes code a bit
easier to read, as the meaning is more explicit.
Instances
containingModuleToMaybe :: ContainingModule -> Maybe ModuleName Source #
Convert a ContainingModule
to a Maybe
ModuleName
, using the obvious
isomorphism.
maybeToContainingModule :: Maybe ModuleName -> ContainingModule Source #
Convert a Maybe
ModuleName
to a ContainingModule
, using the obvious
isomorphism.
fromContainingModule :: ModuleName -> ContainingModule -> ModuleName Source #
A version of fromMaybe
for ContainingModule
values.
fromQualified :: Qualified a -> (ContainingModule, a) Source #
Instances
Eq Namespace Source # | |
Ord Namespace Source # | |
Defined in Language.PureScript.Docs.RenderedCode.Types | |
Show Namespace Source # | |
Generic Namespace Source # | |
NFData Namespace Source # | |
Defined in Language.PureScript.Docs.RenderedCode.Types | |
ToJSON Namespace Source # | |
Defined in Language.PureScript.Docs.RenderedCode.Types | |
FromJSON Namespace Source # | |
type Rep Namespace Source # | |
Defined in Language.PureScript.Docs.RenderedCode.Types type Rep Namespace = D1 (MetaData "Namespace" "Language.PureScript.Docs.RenderedCode.Types" "purescript-0.13.0-1whdl2565Nb1wvlLK7uK18" False) (C1 (MetaCons "ValueLevel" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "TypeLevel" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "KindLevel" PrefixI False) (U1 :: Type -> Type))) |
type FixityAlias = Qualified (Either (ProperName TypeName) (Either Ident (ProperName ConstructorName))) Source #
data RenderedCode Source #
A type representing a highly simplified version of PureScript code, intended for use in output formats like plain text or HTML.
Instances
outputWith :: Monoid a => (RenderedCodeElement -> a) -> RenderedCode -> a Source #
This function allows conversion of a RenderedCode
value into a value of
some other type (for example, plain text, or HTML). The first argument
is a function specifying how each individual RenderedCodeElement
should be
rendered.
sp :: RenderedCode Source #
A RenderedCode
fragment representing a space.
parens :: RenderedCode -> RenderedCode Source #
Wrap a RenderedCode value in parens.
syntax :: Text -> RenderedCode Source #
keyword :: Text -> RenderedCode Source #
typeCtor :: Qualified (ProperName TypeName) -> RenderedCode Source #
typeOp :: Qualified (OpName TypeOpName) -> RenderedCode Source #
typeVar :: Text -> RenderedCode Source #
kind :: Qualified (ProperName KindName) -> RenderedCode Source #
alias :: FixityAlias -> RenderedCode Source #
aliasName :: FixityAlias -> Text -> RenderedCode Source #