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.
- 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.
data ContainingModule Source #
This type is isomorphic to Maybe
ModuleName
. It makes code a bit
easier to read, as the meaning is more explicit.
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 #
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.
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 #