Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Duplicate of the Unison.Util.SyntaxText module, but we expect these to evolve separately. This is the version which is outward facing to the server frontend.
Synopsis
- type SyntaxText = AnnotatedText Element
- type SyntaxSegment = Segment Element
- convertElement :: Element Reference -> Element
- type UnisonHash = Text
- type HashQualifiedName = Text
- data Element
- = NumericLiteral
- | TextLiteral
- | BytesLiteral
- | CharLiteral
- | BooleanLiteral
- | Blank
- | Var
- | TypeReference UnisonHash
- | DataConstructorReference UnisonHash
- | AbilityConstructorReference UnisonHash
- | TermReference UnisonHash
- | Op SeqOp
- | AbilityBraces
- | ControlKeyword
- | TypeOperator
- | BindingEquals
- | TypeAscriptionColon
- | DataTypeKeyword
- | DataTypeParams
- | Unit
- | DataTypeModifier
- | UseKeyword
- | UsePrefix
- | UseSuffix
- | HashQualifier HashQualifiedName
- | DelayForceChar
- | DelimiterChar
- | Parenthesis
- | LinkKeyword
- | DocDelimiter
- | DocKeyword
- syntax :: Element -> SyntaxText -> SyntaxText
- firstReference :: SyntaxText -> Maybe UnisonHash
- reference :: SyntaxSegment -> Maybe UnisonHash
- toPlain :: SyntaxText -> String
- toPlainText :: SyntaxText -> Text
- toHtml :: SyntaxText -> Html ()
- nameToHtml :: Name -> Html ()
- segmentToHtml :: SyntaxSegment -> Html ()
- elementToClassName :: Element -> Text
Documentation
type SyntaxText = AnnotatedText Element Source #
type SyntaxSegment = Segment Element Source #
type UnisonHash = Text Source #
type HashQualifiedName = Text Source #
The elements of the Unison grammar, for syntax highlighting purposes
Instances
syntax :: Element -> SyntaxText -> SyntaxText Source #
reference :: SyntaxSegment -> Maybe UnisonHash Source #
toPlain :: SyntaxText -> String Source #
Convert a SyntaxText
to a Value
, ignoring syntax markup
toPlainText :: SyntaxText -> Text Source #
toHtml :: SyntaxText -> Html () Source #
nameToHtml :: Name -> Html () Source #
segmentToHtml :: SyntaxSegment -> Html () Source #
elementToClassName :: Element -> Text Source #
Orphan instances
FromJSON SeqOp Source # | |
ToJSON SeqOp Source # | |
ToSchema SeqOp Source # | |
FromJSON a => FromJSON (Segment a) Source # | |
ToJSON a => ToJSON (Segment a) Source # | |
ToSchema r => ToSchema (Seq r) Source # | |
declareNamedSchema :: Proxy (Seq r) -> Declare (Definitions Schema) NamedSchema # | |
ToSchema a => ToSchema (Segment a) Source # | |
declareNamedSchema :: Proxy (Segment a) -> Declare (Definitions Schema) NamedSchema # |