Home
package
AsciiDoc
is_eq
validate
from_quote
attributes
materialize_attributes
render_inline_attributes
parse_str
render_inline
render_html
select_include
Lints
ValidationProps
Attribute
Attributes
is_eq
concat
append
is_empty
len
get
map
keep_if
all
Block
is_eq
Resource
Problem
Error
Props
IncludeSelection
IncludeProblem
IncludeProps
CSV
is_eq
to_hash
from_quote
validate
validate_as
parse_string_records
parser
split_header
record
field
string
u64
f64
parse_str
parse_bytes
decode_str
decode
decode_rows
rows_parser
decoder
positional_decoder
typed_decoder
encode_record
encoder
encode
Record
Problem
ValueType
Error
RowError
HeaderMode
Lints
ValidationProps
DecodeValidationProps
Decoded
from_quote
Parseable
DecodeProps
Props
RowsProps
Format
rename_field
parse_str
parse_bool
parse_u8
parse_i8
parse_u16
parse_i16
parse_u32
parse_i32
parse_u64
parse_i64
parse_u128
parse_i128
parse_dec
parse_f32
parse_f64
parse_null
parse_record_start
parse_record_field
parse_record_after_field
skip_record_field
parse_tuple_start
parse_tuple_next
invalid_value
parse_tuple_end
missing_field
parse_tag_union
Resource
ReaderLimits
ReaderProps
PositionalProps
TypedProps
LineEnding
Quoting
WriteProps
State
HTTP
parse_requests
requests_parser
Lints
ValidationProps
ParseProps
Method
Version
Header
Request
is_eq
to_hash
parse_bytes
parser
header
validate
from_quote
decoder
Response
is_eq
to_hash
parse_bytes
parser
header
validate
from_quote
decoder
DecoderProps
Resource
Problem
Error
ReadLimits
ReadProps
RequestHead
ResponseHead
Event
Html
parse_str
parse_fragment
parse_source
validate
from_quote
parse_segments
RepairContext
from_parent
child
text
Props
RepairProblem
RepairProps
Props
ValidationProps
SourceProps
Fragment
validate
from_quote
single_element
Template
from_quote
from_interpolation
JsonValue
is_eq
to_hash
validate
from_quote
parse_str
record_decoder
record_encoder
parser
get
at
get_path
keys
as_str
as_bool
as_list
as_object
as_i64
as_u64
as_dec
encode
Error
Resource
NumberProblem
Problem
Props
ValidationProps
RecordProps
RecordWriteProps
WriteProps
Markdown
to_inspect
is_eq
validate
to_hash
parse_str
parse_inlines
parser
inline_parser
frontmatter
Lints
ValidationProps
Document
from_quote
Problem
Error
Level
to_inspect
to_str
is_eq
to_hash
ListKind
to_inspect
to_str
is_eq
to_hash
TaskState
to_inspect
to_str
is_eq
to_hash
Alignment
to_inspect
to_str
is_eq
to_hash
LinkTarget
Inline
to_inspect
is_eq
to_hash
Props
Markup
validate_tree
parse_xml
parse_xml_fragment
whitespace
html_namespace
svg_namespace
mathml_namespace
element_names
aria_attribute_names
Context
from_parent
child
text
Props
ChildProps
Template
Plan
metadata
bind
Bound
metadata
binding
Slot
ContextProblem
ContextProps
ContextChildProps
Syntax
Span
Token
Source
is_eq
to_hash
from_bytes
from_tokens
partition_valid
from_str
slice
position
ValueGrammar
ValueLanguage
StructureReason
ChildGrammar
UnsupportedReason
ActualRoot
Resource
InterpolationProblem
Problem
Error
Props
InitialNewlineState
is_eq
to_hash
from_behavior
is_pending
step
Token
InitialNewlineToken
Name
is_eq
to_hash
from_qualified
qualified
is_known_element
is_custom_element
is_known_attribute
is_aria_attribute
is_boolean_attribute
attribute_grammar
enumerated_values
is_void_element
text_behavior
drops_initial_newline
initial_newline
is_event_handler
Namespace
Context
Problem
QualifiedProps
AttributeProps
TextProps
NameProps
AttributeProps
NameTextProps
Attribute
Origin
Node
Tree
is_eq
to_hash
single_root
text
Parsed
MathML
parse_str
parse_fragment
validate
from_quote
parse_segments
Props
ValidationProps
Template
from_interpolation
from_quote
Fragment
validate
from_quote
single_element
OFX
is_eq
to_hash
decoder
encoder
parse_bytes
parse_str
parser
validate
from_quote
encode
Resource
Problem
Error
Syntax
TextEncoding
Props
WriteProps
Account
Status
Header
Context
Transaction
Balance
Event
Statement
ValidationProps
Parser
decoder
encoder
parse_str
run_str
custom
run
parse
fail
const
alt
one_of
map_problem
map
map2
map3
flatten
and_then
lazy
maybe
many
one_or_more
between
sep_by_one_or_more
sep_by
ignore
keep
skip
chomp_until
chomp_while
span
Utf8
codeunit_satisfies
codeunit
utf8
string
any_codeunit
rest
rest_str
digit
digits
find_any
skip_class
find_line_end
span_class
Bytes
Problem
ByteClass
from_bytes
from_predicate
complement
contains
Quotation
require
error
position
check
ErrorProps
CheckProps
Diagnostic
is_eq
to_hash
excerpt
line_column
byte_offset
Location
UnavailableReason
PathSegment
Observed
Excerpt
Location
PathSegment
UnavailableReason
Observed
Excerpt
is_eq
to_hash
from_bytes
RecoveryProps
InputEnd
Step
Decoder
read_iter
read_stream
collect
collect_report
values_stream
metadata
step
Encoder
write_iter
write_stream
ReadEvent
ReadError
ProtocolProblem
RecoveryProblem
ChunkSizeProblem
Report
TextEncoding
EncodingError
DecoderProps
EncoderProps
Problem
ParseResult
QIF
validate
from_quote
parse_str
parse_bytes
parser
decoder
transaction_decoder
transactions
decode
field
amount_to_dec
write_event
encoder
encode
Location
Resource
Problem
Error
TextEncoding
DateOrder
Props
Field
Record
Event
Date
Split
Transaction
WriteProps
ValidationProps
Decoder
TransactionEvent
TransactionDecoder
RocSyntax
from_quote
validate
tokenize_bytes
tokenize_str
highlight_category
parse_str
parse_bytes
Span
TokenKind
Token
NodeKind
Node
DiagnosticCode
Diagnostic
Status
Parsed
LintProps
ValidateProps
ValidationProblem
Error
Tokenized
HighlightCategory
Mode
Props
Svg
parse_str
parse_fragment
validate
from_quote
parse_segments
Path
is_eq
parse_str
validate
from_quote
Command
Problem
Error
Props
Props
ValidationProps
Template
from_interpolation
from_quote
Fragment
validate
from_quote
single_element
Xml
is_eq
to_hash
decoder
fold_source
reader
parse_str
parser
validate
from_quote
Namespaced
is_eq
to_hash
parse_str
reader
decoder
fold_source
encode
xml_namespace
xmlns_namespace
Namespace
Name
Binding
Attribute
Node
is_eq
to_hash
name
attribute
children_named
text
Problem
NamespaceProblem
ReadError
StreamError
Event
Reader
next
element
metadata
SourceAttribute
SourceEvent
Decoder
Metadata
Props
WriteProps
EncodeProblem
AttributeOrder
Lints
ValidationProps
Attribute
TextEncoding
Declaration
Version
Node
is_eq
to_hash
name
attribute
children_named
text
Problem
Construct
Error
ReaderProps
Props
Limit
ReadError
StreamProps
StreamError
Metadata
Decoder
SourceSpan
SourceStart
SourceEvent
Event
Reader
next
element
element_with
metadata
Yaml
tokenize_str
tokenize_bytes
highlight_category
is_eq
to_hash
from_quote
validate
validate_as
parse_str
parser
get
at
get_path
as_str
as_i64
as_bool
as_list
to_inspect
decode_str
value_parser
Expected
Actual
NumericType
Resource
Problem
Error
Span
TokenKind
TokenRole
ScalarCategory
Token
DiagnosticCode
Diagnostic
TokenStatus
Tokenized
HighlightCategory
Lints
ValidationProps
DecodeValidationProps
Decoded
from_quote
Props
DecodeProps
Parseable
Format
rename_field
parse_str
parse_bool
parse_u8
parse_i8
parse_u16
parse_i16
parse_u32
parse_i32
parse_u64
parse_i64
parse_u128
parse_i128
parse_dec
parse_f32
parse_f64
parse_null
missing_field
parse_tag_union
parse_list_start
parse_list_next
parse_list_after_item
parse_tuple_start
parse_tuple_next
parse_tuple_end
parse_record_start
parse_record_field
parse_record_after_field
skip_record_field
parse_dict_start
parse_dict_next
parse_dict_after_key
parse_dict_after_entry
invalid_value
parse_key_str
parse_key_u8
parse_key_i8
parse_key_u16
parse_key_i16
parse_key_u32
parse_key_i32
parse_key_u64
parse_key_i64
Cursor
AsciiDoc
AsciiDoc
.
is_eq
: _
AsciiDoc
.
validate
:
ValidationProps
->
Try
(
AsciiDoc
, [
InvalidAsciiDoc
(
Error
),
Unsupported
(
Error
)])
AsciiDoc
.
from_quote
:
Str
->
Try
(
AsciiDoc
, [
BadQuotedBytes
(
Str
)])
AsciiDoc
.
attributes
:
List
(
Attribute
)
->
Attributes
AsciiDoc
.
materialize_attributes
:
Attributes
->
List
(
Attribute
)
AsciiDoc
.
render_inline_attributes
:
Str
,
Attributes
->
Str
AsciiDoc
.
parse_str
:
Str
,
Props
->
Try
(
AsciiDoc
, [
Unsupported
(
Error
),
InvalidAsciiDoc
(
Error
)])
AsciiDoc
.
render_inline
:
Str
,
List
(
Attribute
)
->
Str
AsciiDoc
.
render_html
:
AsciiDoc
->
Str
AsciiDoc
.
select_include
:
Str
,
Str
,
IncludeProps
->
IncludeSelection
AsciiDoc
.
Lints
:= { unexpanded_includes :
Bool
?? True }
AsciiDoc
.
ValidationProps
:= { source :
Str
, name :
Str
?? "<literal>", lints :
Lints
?? {}, includes :
List
({ path :
Str
, source :
Str
}) ?? [], attributes :
List
(
Attribute
) ?? [], max_depth :
U64
?? 16, expand_includes :
Bool
?? False }
AsciiDoc
.
Attribute
: { name :
Str
, value :
Str
}
AsciiDoc
.
Attributes
AsciiDoc.Attributes
.
is_eq
:
Attributes
,
Attributes
->
Bool
AsciiDoc.Attributes
.
concat
:
Attributes
,
Attributes
->
Attributes
AsciiDoc.Attributes
.
append
:
Attributes
,
Attribute
->
Attributes
AsciiDoc.Attributes
.
is_empty
:
Attributes
->
Bool
AsciiDoc.Attributes
.
len
:
Attributes
->
U64
AsciiDoc.Attributes
.
get
:
Attributes
,
U64
->
Try
(
Attribute
, [
OutOfBounds
])
AsciiDoc.Attributes
.
map
:
Attributes
, (
Attribute
->
Attribute
)
->
Attributes
AsciiDoc.Attributes
.
keep_if
:
Attributes
, (
Attribute
->
Bool
)
->
Attributes
AsciiDoc.Attributes
.
all
:
Attributes
, (
Attribute
->
Bool
)
->
Bool
AsciiDoc
.
Block
:= [
Paragraph
(
Str
),
Section
({ level :
U64
, title :
Str
, blocks :
List
(
Block
) }),
Listing
(
Str
),
Literal
(
Str
),
ThematicBreak
,
Rich
({ context :
Str
, source :
Str
, title :
Str
, style :
Str
, id :
Str
, attrs :
Attributes
, blocks :
List
(
Block
), level :
U64
})]
AsciiDoc.Block
.
is_eq
: _
AsciiDoc
.
Resource
: [
SourceBytes
,
BlockDepth
,
ListDepth
]
AsciiDoc
.
Problem
: [
UnexpandedInclude
(
Problem
),
Preprocessing
(
Problem
),
LimitExceeded
({ resource :
Resource
, max :
U64
, observed :
Observed
})]
AsciiDoc
.
Error
:
Diagnostic
(
Problem
)
AsciiDoc
.
Props
:= { includes :
List
({ path :
Str
, source :
Str
}) ?? [], attributes :
List
(
Attribute
) ?? [], max_depth :
U64
?? 16, expand_includes :
Bool
?? False }
AsciiDoc
.
IncludeSelection
: { text :
Str
, lines :
List
(
U64
), problems :
List
(
IncludeProblem
) }
AsciiDoc
.
IncludeProblem
: [
MissingTag
(
Str
),
UnclosedTag
(
Str
),
UnmatchedEnd
(
Str
),
InvalidLines
(
Str
),
EmptySelection
]
AsciiDoc
.
IncludeProps
:= { tabsize :
U64
?? 0 }
CSV
CSV
.
is_eq
: _
CSV
.
to_hash
: _
CSV
.
from_quote
:
Str
->
Try
(
CSV
, [
BadQuotedBytes
(
Str
)])
CSV
.
validate
:
ValidationProps
->
Try
(
List
(
Record
), [
InvalidCsv
(
Error
)])
CSV
.
validate_as
:
DecodeValidationProps
->
Try
(
List
(
row
), [
InvalidCsv
(
Error
), ..
errs
])
where
[
row
.
Parseable
([
InvalidCsv
(
Error
), ..
errs
])]
CSV
.
parse_string_records
:
Str
,
Props
->
Try
(
List
(
List
(
Str
)), [
InvalidCsv
(
Error
)])
CSV
.
parser
:
Props
->
Parser
(
Bytes
,
CSV
, [
InvalidCsv
(
Error
)])
CSV
.
split_header
:
CSV
->
{ header :
List
(
Str
), rows :
List
(
Record
) }
CSV
.
record
:
a
->
Parser
(
Record
,
a
,
p
)
CSV
.
field
:
Parser
(
Bytes
,
a
,
p
)
->
Parser
(
Record
,
a
, [
MissingField
,
UnconsumedField
(
U64
),
FieldProblem
(
Diagnostic
(
Problem
(
p
)))])
CSV
.
string
: {}
->
Parser
(
Bytes
,
Str
,
Problem
(
p
))
CSV
.
u64
: {}
->
Parser
(
Bytes
,
U64
,
Problem
(
p
))
CSV
.
f64
: {}
->
Parser
(
Bytes
,
F64
,
Problem
(
p
))
CSV
.
parse_str
:
Str
,
Props
->
Try
(
CSV
, [
InvalidCsv
(
Error
)])
CSV
.
parse_bytes
:
List
(
U8
),
Props
->
Try
(
CSV
, [
InvalidCsv
(
Error
)])
CSV
.
decode_str
:
Str
,
DecodeProps
->
Try
(
List
(
row
), [
InvalidCsv
(
Error
), ..
errs
])
where
[
row
.
Parseable
([
InvalidCsv
(
Error
), ..
errs
])]
CSV
.
decode
:
CSV
,
DecodeProps
->
Try
(
List
(
row
), [
InvalidCsv
(
Error
), ..
errs
])
where
[
row
.
Parseable
([
InvalidCsv
(
Error
), ..
errs
])]
CSV
.
decode_rows
:
CSV
,
RowsProps
(
row
,
problem
)
->
Try
(
List
(
row
), [
InvalidCsv
(
Error
),
InvalidRow
(
RowError
(
problem
))])
CSV
.
rows_parser
:
RowsProps
(
row
,
problem
)
->
Parser
(
Bytes
,
List
(
row
), [
InvalidCsv
(
Error
),
InvalidRow
(
RowError
(
problem
))])
CSV
.
decoder
:
ReaderProps
->
Decoder
(
State
,
Record
, [
InvalidCsv
(
Error
)])
CSV
.
positional_decoder
:
PositionalProps
(
row
,
p
)
->
Decoder
(
State
,
row
, [
InvalidCsv
(
Error
),
InvalidRow
(
RowError
(
p
))])
CSV
.
typed_decoder
:
TypedProps
->
Decoder
(
TypedState
,
row
, [
InvalidCsv
(
Error
), ..
errs
])
where
[
row
.
Parseable
([
InvalidCsv
(
Error
), ..
errs
])]
CSV
.
encode_record
:
Record
,
WriteProps
->
Try
(
List
(
U8
), [
InvalidCsv
(
Error
)])
CSV
.
encoder
:
WriteProps
->
Encoder
(
U64
,
Record
, [
InvalidCsv
(
Error
)])
CSV
.
encode
:
CSV
,
WriteProps
->
Try
(
List
(
U8
), [
InvalidCsv
(
Error
),
InvalidChunkSize
(
Diagnostic
(
ChunkSizeProblem
))])
CSV
.
Record
:
List
(
List
(
U8
))
CSV
.
Problem
: [
Syntax
(
Problem
),
ExpectedValue
({ expected :
ValueType
, source :
Excerpt
}),
MissingField
,
WidthMismatch
({ found :
U64
, expected :
U64
}),
EmptyHeader
,
DuplicateHeader
(
Str
),
MissingRequiredField
(
Str
),
EmptyRecord
,
LimitExceeded
({ resource :
Resource
, max :
U64
, observed :
Observed
}),
UnsupportedCell
([
Record
,
Tuple
,
TagPayload
]),
InvalidValue
,
UnknownTag
(
Excerpt
), ..
p
]
CSV
.
ValueType
: [
Text
,
Boolean
,
Empty
,
U8
,
I8
,
U16
,
I16
,
U32
,
I32
,
U64
,
I64
,
U128
,
I128
,
Dec
,
F32
,
F64
]
CSV
.
Error
:
Diagnostic
(
Problem
([]))
CSV
.
RowError
:
Diagnostic
([
ParserFailure
(
Problem
(
problem
)),
UnreadFields
({ found :
U64
, read :
U64
})])
CSV
.
HeaderMode
: [
Absent
,
Exact
,
Normalized
]
CSV
.
Lints
:= { duplicate_headers :
Bool
?? True, empty_headers :
Bool
?? True }
CSV
.
ValidationProps
:= { source :
Str
, name :
Str
?? "<literal>", header :
HeaderMode
?? Absent, lints :
Lints
?? {} }
CSV
.
DecodeValidationProps
:= { source :
Str
, name :
Str
?? "<literal>", header :
HeaderMode
?? Exact, lints :
Lints
?? {} }
CSV
.
Decoded
:= { value :
List
(
row
) }
CSV.Decoded
.
from_quote
:
Str
->
Try
(
Decoded
(
row
), [
BadQuotedBytes
(
Str
)])
where
[
row
.
Parseable
([
InvalidCsv
(
Error
), ..
errs
])]
CSV
.
Parseable
:
row
where
[
row
.parser_for :
Format
(
errs
)
->
(
State
->
Try
({ value :
row
, rest :
State
},
errs
))]
CSV
.
DecodeProps
:= { header :
HeaderMode
?? Exact }
CSV
.
Props
:= { header :
HeaderMode
?? Absent, validation : [
SyntaxOnly
,
Checked
(
Lints
)] ?? SyntaxOnly }
CSV
.
RowsProps
:= { row :
Parser
(
Record
,
row
,
problem
) }
CSV
.
Format
CSV.Format
.
rename_field
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
Str
->
Str
CSV.Format
.
parse_str
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
({ value :
Str
, rest :
State
}, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_bool
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
({ value :
Bool
, rest :
State
}, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_u8
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
({ value :
U8
, rest :
State
}, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_i8
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
({ value :
I8
, rest :
State
}, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_u16
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
({ value :
U16
, rest :
State
}, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_i16
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
({ value :
I16
, rest :
State
}, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_u32
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
({ value :
U32
, rest :
State
}, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_i32
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
({ value :
I32
, rest :
State
}, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_u64
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
({ value :
U64
, rest :
State
}, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_i64
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
({ value :
I64
, rest :
State
}, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_u128
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
({ value :
U128
, rest :
State
}, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_i128
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
({ value :
I128
, rest :
State
}, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_dec
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
({ value :
Dec
, rest :
State
}, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_f32
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
({ value :
F32
, rest :
State
}, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_f64
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
({ value :
F64
, rest :
State
}, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_null
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
(
State
, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_record_start
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
([
Counted
({ len :
U64
, rest :
State
}),
Uncounted
(
State
)], [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_record_field
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
FieldNames
(
_shape
),
State
->
Try
([
Field
({ field :
FieldName
(
_shape
), rest :
State
}),
TryField
({ name :
Str
, rest :
State
}),
TryFieldCaseless
({ name :
Str
, rest :
State
}),
Continue
(
State
),
Done
(
State
)], [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_record_after_field
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
([
Continue
(
State
),
Done
(
State
)], [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
skip_record_field
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
(
State
, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_tuple_start
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
,
U64
->
Try
(
State
, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
parse_tuple_next
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
,
U64
,
U64
->
Try
(
State
, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
invalid_value
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
->
[
InvalidCsv
(
Error
), ..
errors
]
CSV.Format
.
parse_tuple_end
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
,
U64
->
Try
(
State
, [
InvalidCsv
(
Error
), ..
errors
])
CSV.Format
.
missing_field
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
Str
->
[
InvalidCsv
(
Error
), ..
errors
]
CSV.Format
.
parse_tag_union
:
Format
([
InvalidCsv
(
Error
), ..
errors
]),
ParseTagUnionSpec
(
a
,
Format
([
InvalidCsv
(
Error
), ..
errors
]),
State
, [
InvalidCsv
(
Error
), ..
errors
]),
State
->
Try
({ value :
a
, rest :
State
}, [
InvalidCsv
(
Error
), ..
errors
])
CSV
.
Resource
:
Resource
CSV
.
ReaderLimits
:= { max_field_bytes :
U64
?? default_field_bytes, max_record_bytes :
U64
?? default_record_bytes, max_fields :
U64
?? default_fields }
CSV
.
ReaderProps
:= { max_field_bytes :
U64
?? CSVReader.default_field_bytes, max_record_bytes :
U64
?? CSVReader.default_record_bytes, max_fields :
U64
?? CSVReader.default_fields, errors :
RecoveryProps
?? {} }
CSV
.
PositionalProps
:= { row :
Parser
(
Record
,
row
,
p
), reader :
ReaderLimits
?? {}, errors :
RecoveryProps
?? {} }
CSV
.
TypedProps
:= { header :
HeaderMode
?? Exact, reader :
ReaderLimits
?? {}, errors :
RecoveryProps
?? {} }
CSV
.
LineEnding
: [
CrLf
,
Lf
,
Cr
]
CSV
.
Quoting
: [
Necessary
,
Always
]
CSV
.
WriteProps
:= { line_ending :
LineEnding
?? CrLf, quoting :
Quoting
?? Necessary, max_field_bytes :
U64
?? 16_777_216, max_record_bytes :
U64
?? 67_108_864, max_fields :
U64
?? 65_536, chunk_bytes :
U64
?? 65_536 }
CSV
.
State
HTTP
HTTP
.
parse_requests
:
List
(
U8
),
ParseProps
->
Try
(
List
(
Request
), [
InvalidHttp
(
Error
)])
HTTP
.
requests_parser
:
ParseProps
->
Parser
(
Bytes
,
List
(
Request
),
Problem
)
HTTP
.
Lints
:= { repeated_content_length :
Bool
?? True }
HTTP
.
ValidationProps
:= { source :
Str
, name :
Str
?? "<literal>", lints :
Lints
?? {} }
HTTP
.
ParseProps
:= {}
HTTP
.
Method
: [
Options
,
Get
,
Post
,
Put
,
Delete
,
Head
,
Trace
,
Connect
,
Patch
,
Extension
(
Str
)]
HTTP
.
Version
: { major :
U8
, minor :
U8
}
HTTP
.
Header
: { name :
Str
, value :
Str
}
HTTP
.
Request
:= { method :
Method
, target :
Str
, version :
Version
, headers :
List
(
Header
), body :
List
(
U8
) }
HTTP.Request
.
is_eq
: _
HTTP.Request
.
to_hash
: _
HTTP.Request
.
parse_bytes
:
List
(
U8
),
ParseProps
->
Try
(
Request
, [
InvalidHttp
(
Error
)])
HTTP.Request
.
parser
:
ParseProps
->
Parser
(
Bytes
,
Request
,
Problem
)
HTTP.Request
.
header
:
Request
,
Str
->
Try
(
Str
, [
Missing
])
HTTP.Request
.
validate
:
ValidationProps
->
Try
(
Request
, [
InvalidHttp
(
Error
)])
HTTP.Request
.
from_quote
:
Str
->
Try
(
Request
, [
BadQuotedBytes
(
Str
)])
HTTP.Request
.
decoder
:
ReadProps
->
Decoder
(
IncrementalState
,
Event
, [
InvalidHttp
(
Error
)])
HTTP
.
Response
:= { version :
Version
, status_code :
U16
, reason :
Str
, headers :
List
(
Header
), body :
List
(
U8
) }
HTTP.Response
.
is_eq
: _
HTTP.Response
.
to_hash
: _
HTTP.Response
.
parse_bytes
:
List
(
U8
),
ParseProps
->
Try
(
Response
, [
InvalidHttp
(
Error
)])
HTTP.Response
.
parser
:
ParseProps
->
Parser
(
Bytes
,
Response
,
Problem
)
HTTP.Response
.
header
:
Response
,
Str
->
Try
(
Str
, [
Missing
])
HTTP.Response
.
validate
:
ValidationProps
->
Try
(
Response
, [
InvalidHttp
(
Error
)])
HTTP.Response
.
from_quote
:
Str
->
Try
(
Response
, [
BadQuotedBytes
(
Str
)])
HTTP.Response
.
decoder
:
DecoderProps
->
Decoder
(
IncrementalState
,
Event
, [
InvalidHttp
(
Error
)])
HTTP.Response
.
DecoderProps
:= { methods :
Iter
(
Method
), reader :
ReadLimits
?? {}, errors :
RecoveryProps
?? {} }
HTTP
.
Resource
: [
HeadBytes
,
TrailerBytes
,
LineBytes
,
Headers
,
Trailers
]
HTTP
.
Problem
: [
LimitExceeded
({ resource :
Resource
, max :
U64
, observed :
Observed
}),
DuplicateHost
,
MissingHost
,
CrWithoutLf
,
LfWithoutCr
,
MissingCrlf
,
MissingTarget
,
InvalidTarget
,
InvalidMethod
,
MissingMethod
,
InvalidVersion
,
InvalidStatusWidth
,
InvalidStatus
,
InvalidReasonCharacter
,
InvalidReasonEncoding
,
MissingStatus
,
InvalidFieldEncoding
,
ObsoleteFolding
,
WhitespaceBeforeColon
,
InvalidFieldCharacter
,
InvalidFieldName
,
TransferEncodingHttp10
,
ContentLengthOverflow
,
ConflictingFraming
,
UnsupportedTransferCoding
,
ConflictingContentLength
,
InvalidContentLength
,
IncompleteBody
,
IncompleteChunk
,
MissingChunkCrlf
,
InvalidChunkSize
,
ChunkSizeOverflow
,
WhitespaceAfterChunkSize
,
MissingExtensionName
,
InvalidExtension
,
MissingExtensionValue
,
InvalidQuotedPair
,
InvalidQuotedCharacter
,
UnclosedQuote
,
TrailingContent
,
RepeatedContentLength
,
RepeatedContentLengthValues
,
InvalidBodyChunkSize
,
SourceClosed
,
IncompleteSection
,
MissingRequestMethod
,
ForbiddenTrailer
]
HTTP
.
Error
:
Diagnostic
(
Problem
)
HTTP
.
ReadLimits
:= { max_head_bytes :
U64
?? default_max_head_bytes, max_line_bytes :
U64
?? default_max_line_bytes, max_headers :
U64
?? default_max_headers, max_trailer_bytes :
U64
?? default_max_trailer_bytes, max_trailers :
U64
?? default_max_trailers, max_body_chunk_bytes :
U64
?? default_max_body_chunk_bytes }
HTTP
.
ReadProps
:= { max_head_bytes :
U64
?? default_max_head_bytes, max_line_bytes :
U64
?? default_max_line_bytes, max_headers :
U64
?? default_max_headers, max_trailer_bytes :
U64
?? default_max_trailer_bytes, max_trailers :
U64
?? default_max_trailers, max_body_chunk_bytes :
U64
?? default_max_body_chunk_bytes, errors :
RecoveryProps
?? {} }
HTTP
.
RequestHead
: { method :
Method
, target :
Str
, version :
Version
, headers :
List
(
Header
) }
HTTP
.
ResponseHead
: { version :
Version
, status_code :
U16
, reason :
Str
, headers :
List
(
Header
) }
HTTP
.
Event
: [
RequestHead
(
RequestHead
),
ResponseHead
(
ResponseHead
),
Body
(
List
(
U8
)),
Trailer
(
Header
),
MessageEnd
,
ProtocolSwitch
,
ProtocolData
(
List
(
U8
))]
Html
Html
.
parse_str
:
Str
,
Props
->
Try
(
Html
, [
InvalidMarkup
(
Error
)])
Html
.
parse_fragment
:
Str
,
Props
->
Try
(
Fragment
, [
InvalidMarkup
(
Error
)])
Html
.
parse_source
:
Str
,
SourceProps
->
Try
(
Parsed
, [
InvalidMarkup
(
Error
)])
Html
.
validate
:
ValidationProps
->
Try
(
Html
, [
InvalidMarkup
(
Error
)])
Html
.
from_quote
:
Str
->
Try
(
Html
, [
BadQuotedBytes
(
Str
)])
Html
.
parse_segments
:
List
(
Str
),
Props
->
Try
(
Plan
, [
InvalidMarkup
(
Error
)])
Html
.
RepairContext
Html.RepairContext
.
from_parent
:
Props
->
RepairContext
Html.RepairContext
.
child
:
RepairContext
,
Name
->
Try
(
RepairContext
, [
InvalidConstruction
(
Diagnostic
(
Problem
))])
Html.RepairContext
.
text
:
RepairContext
,
Str
->
Try
({}, [
InvalidConstruction
(
Diagnostic
(
Problem
))])
Html.RepairContext
.
Props
:= { parent :
Name
, scripting : [
Enabled
,
Disabled
] ?? Enabled }
Html
.
RepairProblem
:
Problem
Html
.
RepairProps
:= { parent :
Name
, scripting : [
Enabled
,
Disabled
] ?? Enabled }
Html
.
Props
:= { syntax :
Syntax
?? HtmlSyntax, exact_structure :
Bool
?? False, strict_foreign_spelling :
Bool
?? False, recovery : [
Strict
,
Browser
] ?? Strict, allow_unknown_elements :
Bool
?? False, allow_unknown_attributes :
Bool
?? False, check_values :
Bool
?? True, max_source_bytes :
U64
?? 16_777_216, max_depth :
U64
?? 1024, max_elements :
U64
?? 4_194_304, max_nodes :
U64
?? 4_194_304, max_slots :
U64
?? 65_536, max_attributes :
U64
?? 1024, max_diagnostics :
U64
?? 1024, max_work_per_byte :
U64
?? 256, context_namespace :
Str
?? "http://www.w3.org/1999/xhtml", context_element :
Str
?? "body", scripting :
Bool
?? True }
Html
.
ValidationProps
:= { source :
Str
, name :
Str
?? "<literal>", options :
Props
?? {} }
Html
.
SourceProps
:= { mode : [
Document
,
Fragment
] ?? Document, options :
Props
?? {} }
Html
.
Fragment
:= { parsed :
Parsed
}
Html.Fragment
.
validate
:
ValidationProps
->
Try
(
Fragment
, [
InvalidMarkup
(
Error
)])
Html.Fragment
.
from_quote
:
Str
->
Try
(
Fragment
, [
BadQuotedBytes
(
Str
)])
Html.Fragment
.
single_element
:
Fragment
->
Try
(
Node
, [
RootCount
(
U64
)])
Html
.
Template
:= { bound :
Bound
(
a
) }
Html.Template
.
from_quote
:
Str
->
Try
(
Template
(
a
), [
BadQuotedBytes
(
Str
)])
Html.Template
.
from_interpolation
:
List
(
Str
)
->
Try
(
Iter
(
a
)
->
Template
(
a
), [
InvalidInterpolation
(
Str
)])
JsonValue
JsonValue
.
is_eq
: _
JsonValue
.
to_hash
: _
JsonValue
.
validate
:
ValidationProps
->
Try
(
JsonValue
, [
InvalidJsonValue
(
Error
)])
JsonValue
.
from_quote
:
Str
->
Try
(
JsonValue
, [
BadQuotedBytes
(
Str
)])
JsonValue
.
parse_str
:
Str
,
Props
->
Try
(
JsonValue
, [
InvalidJsonValue
(
Error
)])
JsonValue
.
record_decoder
:
RecordProps
->
Decoder
(
JsonValue
)
JsonValue
.
record_encoder
:
RecordWriteProps
->
Encoder
(
JsonValue
)
JsonValue
.
parser
:
Props
->
Parser
(
Bytes
,
JsonValue
,
Problem
)
JsonValue
.
get
:
JsonValue
,
Str
->
Try
(
JsonValue
, [
Missing
])
JsonValue
.
at
:
JsonValue
,
U64
->
Try
(
JsonValue
, [
Missing
])
JsonValue
.
get_path
:
JsonValue
,
List
(
Str
)
->
Try
(
JsonValue
, [
Missing
])
JsonValue
.
keys
:
JsonValue
->
List
(
Str
)
JsonValue
.
as_str
:
JsonValue
->
Try
(
Str
, [
WrongType
])
JsonValue
.
as_bool
:
JsonValue
->
Try
(
Bool
, [
WrongType
])
JsonValue
.
as_list
:
JsonValue
->
Try
(
List
(
JsonValue
), [
WrongType
])
JsonValue
.
as_object
:
JsonValue
->
Try
(
List
({ key :
Str
, value :
JsonValue
}), [
WrongType
])
JsonValue
.
as_i64
:
JsonValue
->
Try
(
I64
, [
WrongType
,
OutOfRange
])
JsonValue
.
as_u64
:
JsonValue
->
Try
(
U64
, [
WrongType
,
OutOfRange
])
JsonValue
.
as_dec
:
JsonValue
->
Try
(
Dec
, [
WrongType
,
OutOfRange
])
JsonValue
.
encode
:
JsonValue
,
WriteProps
->
Try
(
List
(
U8
), [
InvalidJsonValue
(
Error
)])
JsonValue
.
Error
:
Diagnostic
(
Problem
)
JsonValue
.
Resource
:
Resource
JsonValue
.
NumberProblem
:
NumberProblem
JsonValue
.
Problem
:
Problem
JsonValue
.
Props
:= { max_bytes :
U64
?? U64.highest, max_depth :
U64
?? 128, max_items :
U64
?? U64.highest, max_string_bytes :
U64
?? U64.highest, max_number_digits :
U64
?? U64.highest, comments :
Bool
?? False, trailing_commas :
Bool
?? False, bom :
Bool
?? False, non_finite :
Bool
?? False, control_characters :
Bool
?? False, lone_surrogates : [
Reject
,
Replace
] ?? Reject, duplicates : [
Reject
,
CollapseIdentical
,
KeepFirst
,
KeepLast
] ?? Reject, top_level : [
Any
,
ObjectOrArray
,
Object
] ?? Any, interoperable_numbers :
Bool
?? False }
JsonValue
.
ValidationProps
:= { source :
Str
, name :
Str
?? "<literal>", options :
Props
?? {} }
JsonValue
.
RecordProps
:= { framing :
Framing
?? Ndjson, json :
Props
?? {}, max_record_bytes :
U64
?? 4_194_304, errors :
RecoveryProps
?? {} }
JsonValue
.
RecordWriteProps
:= { framing :
Framing
?? Ndjson, sort_keys :
Bool
?? False, max_record_bytes :
U64
?? 4_194_304, chunk_bytes :
U64
?? 65_536 }
JsonValue
.
WriteProps
:= { sort_keys :
Bool
?? False, indent :
U64
?? 0, max_bytes :
U64
?? U64.highest }
Markdown
Markdown
.
to_inspect
:
Markdown
->
Str
Markdown
.
is_eq
: _
Markdown
.
validate
:
ValidationProps
->
Try
(
List
(
Markdown
), [
InvalidMarkdown
(
Error
)])
Markdown
.
to_hash
: _
Markdown
.
parse_str
:
Str
,
Props
->
List
(
Markdown
)
Markdown
.
parse_inlines
:
Str
->
List
(
Inline
)
Markdown
.
parser
:
Props
->
Parser
(
Bytes
,
List
(
Markdown
), [])
Markdown
.
inline_parser
:
Parser
(
Bytes
,
List
(
Inline
), [])
Markdown
.
frontmatter
:
List
(
Markdown
)
->
Try
(
Str
, [
Missing
])
Markdown
.
Lints
:= { unclosed_fences :
Bool
?? True }
Markdown
.
ValidationProps
:= { source :
Str
, name :
Str
?? "<literal>", lints :
Lints
?? {} }
Markdown
.
Document
:= { blocks :
List
(
Markdown
) }
Markdown.Document
.
from_quote
:
Str
->
Try
(
Document
, [
BadQuotedBytes
(
Str
)])
Markdown
.
Problem
: [
UnclosedFence
]
Markdown
.
Error
:
Diagnostic
(
Problem
)
Markdown
.
Level
:= [
One
,
Two
,
Three
,
Four
,
Five
,
Six
]
Markdown.Level
.
to_inspect
:
Level
->
Str
Markdown.Level
.
to_str
:
Level
->
Str
Markdown.Level
.
is_eq
: _
Markdown.Level
.
to_hash
: _
Markdown
.
ListKind
:= [
Unordered
,
Ordered
({ start :
U64
})]
Markdown.ListKind
.
to_inspect
:
ListKind
->
Str
Markdown.ListKind
.
to_str
:
ListKind
->
Str
Markdown.ListKind
.
is_eq
: _
Markdown.ListKind
.
to_hash
: _
Markdown
.
TaskState
:= [
NoTask
,
Unchecked
,
Checked
]
Markdown.TaskState
.
to_inspect
:
TaskState
->
Str
Markdown.TaskState
.
to_str
:
TaskState
->
Str
Markdown.TaskState
.
is_eq
: _
Markdown.TaskState
.
to_hash
: _
Markdown
.
Alignment
:= [
Default
,
Left
,
Center
,
Right
]
Markdown.Alignment
.
to_inspect
:
Alignment
->
Str
Markdown.Alignment
.
to_str
:
Alignment
->
Str
Markdown.Alignment
.
is_eq
: _
Markdown.Alignment
.
to_hash
: _
Markdown
.
LinkTarget
: { href :
Str
, title :
Try
(
Str
, [
Missing
]) }
Markdown
.
Inline
:= [
Text
(
Str
),
Strong
(
List
(
Inline
)),
Emphasis
(
List
(
Inline
)),
Strikethrough
(
List
(
Inline
)),
InlineCode
(
Str
),
Link
({ label :
List
(
Inline
), target :
LinkTarget
}),
Image
({ alt :
List
(
Inline
), target :
LinkTarget
}),
HardBreak
,
HtmlInline
(
Str
)]
Markdown.Inline
.
to_inspect
:
Inline
->
Str
Markdown.Inline
.
is_eq
: _
Markdown.Inline
.
to_hash
: _
Markdown
.
Props
:= {}
Markup
Markup
.
validate_tree
:
Parsed
,
Props
->
Try
(
Parsed
, [
InvalidMarkup
(
Error
)])
Markup
.
parse_xml
: _
Markup
.
parse_xml_fragment
: _
Markup
.
whitespace
: _
Markup
.
html_namespace
:
Str
Markup
.
svg_namespace
:
Str
Markup
.
mathml_namespace
:
Str
Markup
.
element_names
:
Namespace
->
List
(
Str
)
Markup
.
aria_attribute_names
:
List
(
Str
)
Markup
.
Context
Markup.Context
.
from_parent
:
Props
->
Try
(
Context
, [
InvalidPlacement
(
Diagnostic
(
Problem
))])
Markup.Context
.
child
:
Context
,
ChildProps
->
Try
(
Context
, [
InvalidPlacement
(
Diagnostic
(
Problem
))])
Markup.Context
.
text
:
Context
,
Str
->
Try
({}, [
InvalidPlacement
(
Diagnostic
(
Problem
))])
Markup.Context
.
Props
:= { parent :
Name
, attributes :
List
(
Attribute
) ?? [], syntax :
Syntax
?? HtmlSyntax, scripting : [
Enabled
,
Disabled
] ?? Enabled }
Markup.Context
.
ChildProps
:= { name :
Name
, attributes :
List
(
Attribute
) ?? [] }
Markup
.
Template
Markup.Template
.
Plan
Markup.Template.Plan
.
metadata
:
Plan
->
PlanMetadata
Markup.Template.Plan
.
bind
:
Plan
,
Iter
(
a
)
->
Try
(
Bound
(
a
), [
InvalidMarkup
(
Error
)])
Markup.Template
.
Bound
Markup.Template.Bound
.
metadata
:
Bound
(
a
)
->
{ plan :
Plan
, values :
List
(
a
) }
Markup.Template.Bound
.
binding
:
Bound
(
a
),
U64
->
Try
(
a
, [
Missing
])
Markup.Template
.
Slot
:
Slot
Markup
.
ContextProblem
:
Problem
Markup
.
ContextProps
:= { parent :
Name
, attributes :
List
(
Attribute
) ?? [], syntax :
Syntax
?? HtmlSyntax, scripting : [
Enabled
,
Disabled
] ?? Enabled }
Markup
.
ContextChildProps
:= { name :
Name
, attributes :
List
(
Attribute
) ?? [] }
Markup
.
Syntax
:
Syntax
Markup
.
Span
:
Span
Markup
.
Token
:
Token
Markup
.
Source
:= { bytes :
List
(
U8
), tokens :
List
(
Token
) }
Markup.Source
.
is_eq
: _
Markup.Source
.
to_hash
: _
Markup.Source
.
from_bytes
:
List
(
U8
)
->
Source
Markup.Source
.
from_tokens
:
List
(
U8
),
List
(
Token
)
->
Source
Markup.Source
.
partition_valid
:
Source
->
Bool
Markup.Source
.
from_str
:
Str
->
Source
Markup.Source
.
slice
:
Source
,
Span
->
List
(
U8
)
Markup.Source
.
position
:
Source
,
U64
->
{ line :
U64
, column :
U64
}
Markup
.
ValueGrammar
:
ValueGrammar
Markup
.
ValueLanguage
:
ValueLanguage
Markup
.
StructureReason
:
StructureReason
Markup
.
ChildGrammar
:
ChildGrammar
Markup
.
UnsupportedReason
:
UnsupportedReason
Markup
.
ActualRoot
:
ActualRoot
Markup
.
Resource
:
Resource
Markup
.
InterpolationProblem
:
InterpolationProblem
Markup
.
Problem
:
Problem
Markup
.
Error
:
Error
Markup
.
Props
:= { syntax :
Syntax
?? XmlSyntax, exact_structure :
Bool
?? False, strict_foreign_spelling :
Bool
?? False, allow_unknown_elements :
Bool
?? False, allow_unknown_attributes :
Bool
?? False, check_values :
Bool
?? True, max_source_bytes :
U64
?? 16_777_216, max_depth :
U64
?? 1024, max_elements :
U64
?? 4_194_304, max_nodes :
U64
?? 4_194_304, max_slots :
U64
?? 65_536, max_attributes :
U64
?? 1024, recovery : [
Strict
,
Browser
] ?? Strict, max_diagnostics :
U64
?? 1024, max_work_per_byte :
U64
?? 256 }
Markup
.
InitialNewlineState
Markup.InitialNewlineState
.
is_eq
: _
Markup.InitialNewlineState
.
to_hash
: _
Markup.InitialNewlineState
.
from_behavior
: [
DropInitialLf
,
PreserveInitialLf
]
->
InitialNewlineState
Markup.InitialNewlineState
.
is_pending
:
InitialNewlineState
->
Bool
Markup.InitialNewlineState
.
step
:
InitialNewlineState
,
Token
->
{ state :
InitialNewlineState
, token :
Token
, action : [
Skipped
,
Preserved
] }
Markup.InitialNewlineState
.
Token
: [
Characters
(
Str
),
Comment
,
Other
]
Markup
.
InitialNewlineToken
:
Token
Markup
.
Name
:= { namespace :
Namespace
, local :
Str
, prefix : [
Prefix
(
Str
),
Unprefixed
] }
Markup.Name
.
is_eq
: _
Markup.Name
.
to_hash
: _
Markup.Name
.
from_qualified
:
QualifiedProps
->
Try
(
Name
, [
InvalidDomName
(
Diagnostic
(
Problem
))])
Markup.Name
.
qualified
:
Name
->
Str
Markup.Name
.
is_known_element
:
Name
->
Bool
Markup.Name
.
is_custom_element
:
Name
->
Bool
Markup.Name
.
is_known_attribute
:
Name
,
AttributeProps
->
Bool
Markup.Name
.
is_aria_attribute
:
Name
->
Bool
Markup.Name
.
is_boolean_attribute
:
Name
,
AttributeProps
->
Bool
Markup.Name
.
attribute_grammar
:
Name
,
AttributeProps
->
ValueGrammar
Markup.Name
.
enumerated_values
:
Name
,
AttributeProps
->
Try
(
List
(
Str
), [
NotEnumerated
])
Markup.Name
.
is_void_element
:
Name
->
Bool
Markup.Name
.
text_behavior
:
Name
,
TextProps
->
TextBehavior
Markup.Name
.
drops_initial_newline
:
Name
->
Bool
Markup.Name
.
initial_newline
:
Name
->
InitialNewlineState
Markup.Name
.
is_event_handler
:
Name
,
AttributeProps
->
Bool
Markup.Name
.
Namespace
: [
Uri
(
Str
),
NoNamespace
]
Markup.Name
.
Context
: [
Element
,
Attribute
]
Markup.Name
.
Problem
: [
InvalidCharacter
({ spelling :
Str
, context :
Context
}),
InvalidNamespace
({ namespace :
Namespace
, spelling :
Str
})]
Markup.Name
.
QualifiedProps
:= { namespace :
Namespace
, spelling :
Str
, context :
Context
}
Markup.Name
.
AttributeProps
:= { attribute :
Name
}
Markup.Name
.
TextProps
:= { scripting : [
Enabled
,
Disabled
] ?? Enabled }
Markup
.
NameProps
:= { namespace :
Namespace
, spelling :
Str
, context :
Context
}
Markup
.
AttributeProps
:= { attribute :
Name
}
Markup
.
NameTextProps
:= { scripting : [
Enabled
,
Disabled
] ?? Enabled }
Markup
.
Attribute
:
Attribute
Markup
.
Origin
:
Origin
Markup
.
Node
:
Node
Markup
.
Tree
:= { nodes :
List
(
Node
), roots :
List
(
U64
) }
Markup.Tree
.
is_eq
: _
Markup.Tree
.
to_hash
: _
Markup.Tree
.
single_root
:
Tree
->
Try
(
U64
, [
RootCount
(
U64
)])
Markup.Tree
.
text
:
Tree
,
U64
->
Str
Markup
.
Parsed
:
Parsed
MathML
MathML
.
parse_str
:
Str
,
Props
->
Try
(
MathML
, [
InvalidMarkup
(
Error
)])
MathML
.
parse_fragment
:
Str
,
Props
->
Try
(
Fragment
, [
InvalidMarkup
(
Error
)])
MathML
.
validate
:
ValidationProps
->
Try
(
MathML
, [
InvalidMarkup
(
Error
)])
MathML
.
from_quote
:
Str
->
Try
(
MathML
, [
BadQuotedBytes
(
Str
)])
MathML
.
parse_segments
:
List
(
Str
),
Props
->
Try
(
Plan
, [
InvalidMarkup
(
Error
)])
MathML
.
Props
:
Props
MathML
.
ValidationProps
:= { source :
Str
, name :
Str
?? "<literal>", options :
Props
?? {} }
MathML
.
Template
:= { bound :
Bound
(
a
) }
MathML.Template
.
from_interpolation
:
List
(
Str
)
->
Try
(
Iter
(
a
)
->
Template
(
a
), [
InvalidInterpolation
(
Str
)])
MathML.Template
.
from_quote
:
Str
->
Try
(
Template
(
a
), [
BadQuotedBytes
(
Str
)])
MathML
.
Fragment
:= { parsed :
Parsed
}
MathML.Fragment
.
validate
:
ValidationProps
->
Try
(
Fragment
, [
InvalidMarkup
(
Error
)])
MathML.Fragment
.
from_quote
:
Str
->
Try
(
Fragment
, [
BadQuotedBytes
(
Str
)])
MathML.Fragment
.
single_element
:
Fragment
->
Try
(
Node
, [
RootCount
(
U64
)])
OFX
OFX
.
is_eq
: _
OFX
.
to_hash
: _
OFX
.
decoder
:
Props
->
Decoder
(
State
,
Event
, [
InvalidOfx
(
Error
)])
OFX
.
encoder
:
WriteProps
->
Encoder
(
WriteState
,
Event
, [
InvalidOfx
(
Error
)])
OFX
.
parse_bytes
:
List
(
U8
),
Props
->
Try
(
OFX
, [
InvalidOfx
(
Error
)])
OFX
.
parse_str
:
Str
,
Props
->
Try
(
OFX
, [
InvalidOfx
(
Error
)])
OFX
.
parser
:
Props
->
Parser
(
Bytes
,
OFX
,
Problem
)
OFX
.
validate
:
ValidationProps
->
Try
(
OFX
, [
InvalidOfx
(
Error
)])
OFX
.
from_quote
:
Str
->
Try
(
OFX
, [
BadQuotedBytes
(
Str
)])
OFX
.
encode
:
OFX
,
WriteProps
->
Try
(
List
(
U8
), [
InvalidOfx
(
Error
),
InvalidChunkSize
(
Diagnostic
(
ChunkSizeProblem
))])
OFX
.
Resource
: [
HeaderBytes
,
TokenBytes
,
FieldBytes
,
RecordBytes
,
Depth
,
Fields
,
ExtensionDepth
]
OFX
.
Problem
: [
LimitExceeded
({ resource :
Resource
, max :
U64
, observed :
Observed
}),
IncompleteDocument
,
UnfinishedStatement
,
TrailingContent
,
NonAsciiHeader
,
SyntaxMismatch
,
SelfClosingEndTag
,
EmptyTagName
,
MalformedHeaderField
(
Str
),
DuplicateHeaderField
(
Str
),
UnsupportedHeader
(
Str
),
UnsupportedDataFormat
(
Str
),
UnsupportedEncoding
(
Str
),
CompressionUnsupported
,
UnknownHeaderField
(
Str
),
InconsistentHeader
,
EncodingCharsetMismatch
,
UnsupportedCharset
(
Str
),
HeaderEncodingMismatch
,
NonAsciiByte
,
UnexpectedText
,
InvalidCharacterData
,
InvalidEncoding
(
EncodingError
),
DtdUnsupported
,
PaddedCdataUnsupported
,
MalformedCommentOrCdata
,
SgmlCommentUnsupported
,
CdataPlacementUnsupported
,
ProcessingInstructionPlacement
,
PrologueOrder
,
MalformedXmlDeclaration
,
XmlDeclarationOrder
,
DeclarationEncodingMismatch
,
MalformedProcessingInstruction
,
UnsupportedXmlHeader
,
UnknownProcessingInstruction
,
UnsupportedDeclaration
,
InvalidTagName
(
Str
),
ExpectedRoot
,
MultipleRoots
,
InvestmentUnsupported
,
UnsupportedElement
(
Str
),
UnknownSgmlTag
(
Str
),
NestedScalar
,
NestedStatement
,
InvalidParent
({ element :
Str
, parent :
Str
}),
AccountOrder
,
DuplicateBalance
(
Str
),
NestedRecord
,
RecordOutsideStatement
,
MismatchedClosingTag
({ actual :
Str
, expected :
Try
(
Str
, [
NoOpenElement
]) }),
MalformedRecord
,
EmptyStatement
,
UnexpectedTransactionText
,
NestedTransactionScalar
,
InvalidSignon
,
UnnormalizedContext
,
InvalidContextCharacter
,
InvalidUid
,
InvalidWrapper
,
InvalidCurrency
(
Excerpt
),
MissingAccountId
,
MissingBankId
,
InvalidStartTimestamp
(
Excerpt
),
InvalidEndTimestamp
(
Excerpt
),
UnnormalizedTransaction
,
ExpectedExtensionElement
,
DuplicateExtension
(
Str
),
ExtensionOrder
(
Str
),
InvalidTransactionCharacter
,
InvalidTransactionType
(
Str
),
InvalidPostedTimestamp
(
Excerpt
),
InvalidAmount
(
Excerpt
),
MissingTransactionId
,
InvalidBalance
(
Balance
),
InvalidExtensionText
(
Str
),
InvalidExtensionName
(
Str
),
ExtensionAttributesUnsupported
,
UnknownSgmlExtension
(
Str
),
UnrepresentableCharacter
(
Str
),
HeaderChanged
,
TransactionOutsideList
,
BalanceOutsideStatement
,
BalanceOrder
,
StatementEnded
,
InvalidAggregate
,
UnsupportedScalarField
(
Str
),
FieldAttributesUnsupported
,
MissingXmlDeclaration
,
ContextOrder
(
Str
),
SignonOrder
,
UnsuccessfulResponse
(
Str
),
DuplicateField
(
Str
)]
OFX
.
Error
:
Diagnostic
(
Problem
)
OFX
.
Syntax
: [
Xml203
,
Sgml102
]
OFX
.
TextEncoding
: [
Auto
,
Utf8
,
Windows1252
]
OFX
.
Props
:= { syntax : [
Auto
,
Xml
,
Sgml
] ?? Auto, encoding :
TextEncoding
?? Auto, max_token_bytes :
U64
?? 65_536, max_record_bytes :
U64
?? 4_194_304, max_depth :
U64
?? 64, max_fields :
U64
?? 1024, errors :
RecoveryProps
?? {} }
OFX
.
WriteProps
:= { syntax :
Syntax
?? Xml203, encoding :
TextEncoding
?? Utf8, max_record_bytes :
U64
?? 4_194_304, chunk_bytes :
U64
?? 65_536 }
OFX
.
Account
: { bank_id :
Str
, branch_id :
Str
, account_id :
Str
, account_type :
Str
, key :
Str
}
OFX
.
Status
: { code :
Str
, severity :
Str
, message :
Str
}
OFX
.
Header
: { old_uid :
Str
, new_uid :
Str
, server_date :
Str
, language :
Str
, org :
Str
, fid :
Str
}
OFX
.
Context
: { kind : [
Bank
,
CreditCard
], currency :
Str
, account :
Account
, start :
Str
, end :
Str
, transaction_id :
Str
, status :
Status
, header :
Header
}
OFX
.
Transaction
: { type :
Str
, posted :
Str
, amount :
Str
, id :
Str
, name :
Str
, memo :
Str
, check_number :
Str
, extensions :
List
(
Node
) }
OFX
.
Balance
: { amount :
Str
, as_of :
Str
}
OFX
.
Event
: [
StatementStart
(
Context
),
Transaction
(
Transaction
),
LedgerBalance
(
Balance
),
AvailableBalance
(
Balance
),
StatementEnd
]
OFX
.
Statement
: { context :
Context
, transactions :
List
(
Transaction
), ledger_balance :
Try
(
Balance
, [
Missing
]), available_balance :
Try
(
Balance
, [
Missing
]) }
OFX
.
ValidationProps
:= { source :
Str
, name :
Str
?? "<literal>", options :
Props
?? {} }
Parser
Parser
.
decoder
:
DecoderProps
(
state
,
item
,
problem
)
->
Decoder
(
state
,
item
,
problem
)
Parser
.
encoder
:
EncoderProps
(
state
,
item
,
problem
)
->
Encoder
(
state
,
item
,
problem
)
Parser
.
parse_str
:
Parser
(
List
(
U8
),
a
,
p
),
Str
->
Try
(
a
, [
ParseError
(
Diagnostic
(
Problem
(
p
)))])
Parser
.
run_str
:
Parser
(
List
(
U8
),
a
,
p
),
Str
->
Try
({ value :
a
, rest :
Str
}, [
ParseError
(
Diagnostic
(
Problem
(
p
)))])
Parser
.
custom
: (
input
->
Try
({ value :
a
, rest :
input
}, [
ParseError
(
Diagnostic
([..
p
]))]))
->
Parser
(
input
,
a
,
p
)
where
[
input
.len :
input
->
U64
]
Parser
.
run
:
Parser
(
input
,
a
,
p
),
input
->
ParseResult
(
input
,
a
,
p
)
where
[
input
.len :
input
->
U64
]
Parser
.
parse
:
Parser
(
input
,
a
,
p
),
input
->
Try
(
a
, [
ParseError
(
Diagnostic
(
Problem
(
p
)))])
where
[
input
.len :
input
->
U64
]
Parser
.
fail
:
Problem
(
p
)
->
Parser
(
input
,
a
,
p
)
where
[
input
.len :
input
->
U64
]
Parser
.
const
:
a
->
Parser
(_,
a
,
p
)
Parser
.
alt
:
Parser
(
input
,
a
,
p
),
Parser
(
input
,
a
,
p
)
->
Parser
(
input
,
a
,
p
)
Parser
.
one_of
:
List
(
Parser
(
input
,
a
,
p
))
->
Parser
(
input
,
a
,
p
)
where
[
input
.len :
input
->
U64
]
Parser
.
map_problem
:
Parser
(
input
,
a
,
p
), (
Problem
(
p
)
->
Problem
(
q
))
->
Parser
(
input
,
a
,
q
)
Parser
.
map
:
Parser
(
input
,
a
,
p
), (
a
->
b
)
->
Parser
(
input
,
b
,
p
)
Parser
.
map2
:
Parser
(
input
,
a
,
p
),
Parser
(
input
,
b
,
p
), (
a
,
b
->
c
)
->
Parser
(
input
,
c
,
p
)
Parser
.
map3
:
Parser
(
input
,
a
,
p
),
Parser
(
input
,
b
,
p
),
Parser
(
input
,
c
,
p
), (
a
,
b
,
c
->
d
)
->
Parser
(
input
,
d
,
p
)
Parser
.
flatten
:
Parser
(
input
,
Try
(
a
,
Problem
(
p
)),
p
)
->
Parser
(
input
,
a
,
p
)
where
[
input
.len :
input
->
U64
]
Parser
.
and_then
:
Parser
(
input
,
a
,
p
), (
a
->
Parser
(
input
,
b
,
p
))
->
Parser
(
input
,
b
,
p
)
Parser
.
lazy
: ({}
->
Parser
(
input
,
a
,
p
))
->
Parser
(
input
,
a
,
p
)
Parser
.
maybe
:
Parser
(
input
,
a
,
p
)
->
Parser
(
input
,
Try
(
a
, [
Missing
]),
p
)
Parser
.
many
:
Parser
(
input
,
a
,
p
)
->
Parser
(
input
,
List
(
a
),
p
)
where
[
input
.len :
input
->
U64
]
Parser
.
one_or_more
:
Parser
(
input
,
a
,
p
)
->
Parser
(
input
,
List
(
a
),
p
)
where
[
input
.len :
input
->
U64
]
Parser
.
between
:
Parser
(
input
,
a
,
p
),
Parser
(
input
,
open
,
p
),
Parser
(
input
,
close
,
p
)
->
Parser
(
input
,
a
,
p
)
Parser
.
sep_by_one_or_more
:
Parser
(
input
,
a
,
p
),
Parser
(
input
,
sep
,
p
)
->
Parser
(
input
,
List
(
a
),
p
)
where
[
input
.len :
input
->
U64
]
Parser
.
sep_by
:
Parser
(
input
,
a
,
p
),
Parser
(
input
,
sep
,
p
)
->
Parser
(
input
,
List
(
a
),
p
)
where
[
input
.len :
input
->
U64
]
Parser
.
ignore
:
Parser
(
input
,
a
,
p
)
->
Parser
(
input
, {},
p
)
Parser
.
keep
:
Parser
(
input
,
a
->
b
,
p
),
Parser
(
input
,
a
,
p
)
->
Parser
(
input
,
b
,
p
)
Parser
.
skip
:
Parser
(
input
,
a
,
p
),
Parser
(
input
, _,
p
)
->
Parser
(
input
,
a
,
p
)
Parser
.
chomp_until
:
a
->
Parser
(
List
(
a
),
List
(
a
),
p
)
where
[
a
.is_eq :
a
,
a
->
Bool
]
Parser
.
chomp_while
: (
a
->
Bool
)
->
Parser
(
List
(
a
),
List
(
a
),
p
)
Parser
.
span
:
Parser
(
List
(
item
),
a
,
p
)
->
Parser
(
List
(
item
),
List
(
item
),
p
)
Parser
.
Utf8
Parser.Utf8
.
codeunit_satisfies
: (
U8
->
Bool
)
->
Parser
(
Bytes
,
U8
,
Problem
(
p
))
Parser.Utf8
.
codeunit
:
U8
->
Parser
(
Bytes
,
U8
,
Problem
(
p
))
Parser.Utf8
.
utf8
:
List
(
U8
)
->
Parser
(
Bytes
,
List
(
U8
),
Problem
(
p
))
Parser.Utf8
.
string
:
Str
->
Parser
(
Bytes
,
Str
,
Problem
(
p
))
Parser.Utf8
.
any_codeunit
: {}
->
Parser
(
Bytes
,
U8
,
Problem
(
p
))
Parser.Utf8
.
rest
: {}
->
Parser
(
Bytes
,
Bytes
,
Problem
(
p
))
Parser.Utf8
.
rest_str
: {}
->
Parser
(
Bytes
,
Str
,
Problem
(
p
))
Parser.Utf8
.
digit
: {}
->
Parser
(
Bytes
,
U64
,
Problem
(
p
))
Parser.Utf8
.
digits
: {}
->
Parser
(
Bytes
,
U64
,
Problem
(
p
))
Parser.Utf8
.
find_any
:
Bytes
,
U64
,
ByteClass
->
U64
Parser.Utf8
.
skip_class
:
Bytes
,
U64
,
ByteClass
->
U64
Parser.Utf8
.
find_line_end
:
Bytes
,
U64
->
U64
Parser.Utf8
.
span_class
:
ByteClass
->
Parser
(
Bytes
,
Bytes
,
Problem
(
p
))
Parser.Utf8
.
Bytes
:
List
(
U8
)
Parser.Utf8
.
Problem
: [
UnexpectedEnd
,
ExpectedPredicate
,
ExpectedByte
(
U8
),
ExpectedBytes
(
List
(
U8
)),
InvalidUtf8
,
ExpectedDigit
,
IntegerOverflow
(
U64
), ..
p
]
Parser.Utf8
.
ByteClass
Parser.Utf8.ByteClass
.
from_bytes
:
List
(
U8
)
->
ByteClass
Parser.Utf8.ByteClass
.
from_predicate
: (
U8
->
Bool
)
->
ByteClass
Parser.Utf8.ByteClass
.
complement
:
ByteClass
->
ByteClass
Parser.Utf8.ByteClass
.
contains
:
ByteClass
,
U8
->
Bool
Parser
.
Quotation
Parser.Quotation
.
require
:
Try
(
a
,
error
)
->
a
Parser.Quotation
.
error
:
ErrorProps
->
[
BadQuotedBytes
(
Str
)]
Parser.Quotation
.
position
:
Str
,
U64
->
{ line :
U64
, column :
U64
}
Parser.Quotation
.
check
:
CheckProps
(
a
,
p
)
->
Try
(
a
, [
BadQuotedBytes
(
Str
)])
Parser.Quotation
.
ErrorProps
:= { name :
Str
?? "<literal>", format :
Str
, message :
Str
, line :
U64
?? 0, column :
U64
?? 0 }
Parser.Quotation
.
CheckProps
:= { parser :
Parser
(
List
(
U8
),
a
,
p
), source :
Str
, name :
Str
?? "<literal>" }
Parser
.
Diagnostic
:= { problem :
problem
, location :
Location
, path :
List
(
PathSegment
) }
Parser.Diagnostic
.
is_eq
: _
Parser.Diagnostic
.
to_hash
: _
Parser.Diagnostic
.
excerpt
:
List
(
U8
)
->
Excerpt
Parser.Diagnostic
.
line_column
:
Location
->
Try
({ line :
U64
, column :
U64
}, [
NoTextPosition
])
Parser.Diagnostic
.
byte_offset
:
Location
->
Try
(
U64
, [
NoByteOffset
])
Parser.Diagnostic
.
Location
: [
InputOffset
(
U64
),
ByteOffset
(
U64
),
Text
({ offset :
U64
, line :
U64
, column :
U64
}),
LineColumn
({ line :
U64
, column :
U64
}),
Unavailable
(
UnavailableReason
)]
Parser.Diagnostic
.
UnavailableReason
: [
NotRetained
,
GeneratedValue
,
NotApplicable
]
Parser.Diagnostic
.
PathSegment
: [
Record
(
U64
),
Field
(
U64
),
Index
(
U64
),
Key
(
Str
),
Source
(
Str
)]
Parser.Diagnostic
.
Observed
: [
Exact
(
U64
),
AtLeast
(
U64
)]
Parser.Diagnostic
.
Excerpt
:
Excerpt
Parser
.
Location
:
Location
Parser
.
PathSegment
:
PathSegment
Parser
.
UnavailableReason
:
UnavailableReason
Parser
.
Observed
:
Observed
Parser
.
Excerpt
:= { bytes :
List
(
U8
), total_bytes :
U64
}
Parser.Excerpt
.
is_eq
: _
Parser.Excerpt
.
to_hash
: _
Parser.Excerpt
.
from_bytes
:
List
(
U8
)
->
Excerpt
Parser
.
RecoveryProps
:= { policy :
ErrorPolicy
?? FailFast, max_errors :
U64
?? 1000 }
Parser
.
InputEnd
:
InputEnd
Parser
.
Step
:
Step
(
state
,
item
,
problem
)
Parser
.
Decoder
Parser.Decoder
.
read_iter
:
Decoder
(
state
,
item
,
problem
),
Iter
(
Bytes
)
->
Iter
(
Try
(
ReadEvent
(
item
,
problem
),
ReadError
(
problem
)))
Parser.Decoder
.
read_stream
:
Decoder
(
state
,
item
,
problem
),
Stream
(
Try
(
Bytes
,
source_error
))
->
Stream
(
Try
(
ReadEvent
(
item
,
problem
), [
SourceErr
(
source_error
),
RecoveryLimitExceeded
(
Diagnostic
(
RecoveryProblem
(
problem
))),
DecoderProtocol
(
Diagnostic
(
ProtocolProblem
)), ..
problem
]))
Parser.Decoder
.
collect
:
Decoder
(
state
,
item
,
problem
),
Iter
(
Bytes
)
->
Try
(
List
(
item
), [
MissingFinished
,
SkippedRecords
(
Report
),
RecoveryLimitExceeded
(
Diagnostic
(
RecoveryProblem
(
problem
))),
DecoderProtocol
(
Diagnostic
(
ProtocolProblem
)), ..
problem
])
Parser.Decoder
.
collect_report
:
Decoder
(
state
,
item
,
problem
),
Iter
(
Bytes
)
->
Try
({ values :
List
(
item
), errors :
List
([..
problem
]), report :
Report
}, [
MissingFinished
,
RecoveryLimitExceeded
(
Diagnostic
(
RecoveryProblem
(
problem
))),
DecoderProtocol
(
Diagnostic
(
ProtocolProblem
)), ..
problem
])
Parser.Decoder
.
values_stream
:
Decoder
(
state
,
item
,
problem
),
Stream
(
Try
(
Bytes
,
source_error
))
->
Stream
(
Try
(
item
, [
SourceErr
(
source_error
),
MissingFinished
,
SkippedRecords
(
Report
),
RecoveryLimitExceeded
(
Diagnostic
(
RecoveryProblem
(
problem
))),
DecoderProtocol
(
Diagnostic
(
ProtocolProblem
)), ..
problem
]))
Parser.Decoder
.
metadata
:
Decoder
(
state
,
item
,
problem
)
->
metadata
where
[
state
.metadata :
state
->
metadata
]
Parser.Decoder
.
step
:
Decoder
(
state
,
item
,
problem
), { bytes :
Bytes
, end :
InputEnd
}
->
Step
(
Decoder
(
state
,
item
,
problem
),
item
, [..
problem
])
Parser
.
Encoder
Parser.Encoder
.
write_iter
:
Encoder
(
state
,
item
,
problem
),
Iter
(
item
)
->
Iter
(
Try
(
Bytes
, [
InvalidChunkSize
(
Diagnostic
(
ChunkSizeProblem
)), ..
problem
]))
Parser.Encoder
.
write_stream
:
Encoder
(
state
,
item
,
problem
),
Stream
(
Try
(
item
,
source_error
))
->
Stream
(
Try
(
Bytes
, [
SourceErr
(
source_error
),
InvalidChunkSize
(
Diagnostic
(
ChunkSizeProblem
)), ..
problem
]))
Parser
.
ReadEvent
:
ReadEvent
(
item
,
problem
)
Parser
.
ReadError
:
ReadError
(
problem
)
Parser
.
ProtocolProblem
:
ProtocolProblem
Parser
.
RecoveryProblem
:
RecoveryProblem
(
problem
)
Parser
.
ChunkSizeProblem
:
ChunkSizeProblem
Parser
.
Report
:
Report
Parser
.
TextEncoding
:
TextEncoding
Parser
.
EncodingError
:
EncodingError
Parser
.
DecoderProps
:= { initial_state :
state
, step :
state
,
Bytes
,
InputEnd
->
Step
(
state
,
item
, [..
problem
]), errors :
RecoveryProps
?? {} }
Parser
.
EncoderProps
:= { initial_state :
state
, encode :
state
,
item
->
Try
({ state :
state
, bytes :
Bytes
}, [..
problem
]), finish :
state
->
Try
(
Bytes
, [..
problem
]), chunk_bytes :
U64
?? 65_536 }
Parser
.
Problem
: [
UnexpectedInput
,
NoAlternatives
,
CharacterNotFound
,
Utf8Boundary
, ..
p
]
Parser
.
ParseResult
:
Try
({ value :
a
, rest :
input
}, [
ParseError
(
Diagnostic
(
Problem
(
p
)))])
QIF
QIF
.
validate
:
ValidationProps
->
Try
(
QIF
, [
InvalidQif
(
Error
)])
QIF
.
from_quote
:
Str
->
Try
(
QIF
, [
BadQuotedBytes
(
Str
)])
QIF
.
parse_str
:
Str
,
Props
->
Try
(
QIF
, [
InvalidQif
(
Error
)])
QIF
.
parse_bytes
:
List
(
U8
),
Props
->
Try
(
QIF
, [
InvalidQif
(
Error
)])
QIF
.
parser
:
Props
->
Parser
(
Bytes
,
QIF
,
Problem
)
QIF
.
decoder
:
Props
->
Decoder
QIF
.
transaction_decoder
:
Props
->
TransactionDecoder
QIF
.
transactions
:
QIF
,
Props
->
Try
(
List
(
Transaction
), [
InvalidQif
(
Error
)])
QIF
.
decode
:
Record
,
Props
->
Try
(
Transaction
, [
InvalidQif
(
Error
)])
QIF
.
field
:
Record
,
U8
->
Try
(
Str
, [
Missing
])
QIF
.
amount_to_dec
:
Str
->
Try
(
Dec
, [
BadNumStr
])
QIF
.
write_event
:
Event
,
WriteProps
->
Try
(
List
(
U8
), [
InvalidQif
(
Error
)])
QIF
.
encoder
:
WriteProps
->
Encoder
({ section :
Str
, account :
Str
},
Event
, [
InvalidQif
(
Error
)])
QIF
.
encode
:
QIF
,
WriteProps
->
Try
(
List
(
U8
), [
InvalidQif
(
Error
),
InvalidChunkSize
(
Diagnostic
(
ChunkSizeProblem
))])
QIF
.
Location
: { offset :
U64
, line :
U64
, column :
U64
}
QIF
.
Resource
: [
RecordBytes
,
LineBytes
,
ContextBytes
,
Fields
]
QIF
.
Problem
: [
LimitExceeded
({ resource :
Resource
, max :
U64
, observed :
Observed
}),
IncompleteInput
,
MissingRecordTerminator
,
UnsupportedSection
(
Str
),
DuplicateCoreField
,
MissingField
(
U8
),
InvalidDate
({ value :
Excerpt
, order :
DateOrder
}),
InvalidAmount
(
Excerpt
),
InvalidSplitAmount
,
MissingSplitCategory
,
InvalidHeader
(
Str
),
InvalidField
(
Field
),
UnrepresentableCharacter
(
TextEncoding
),
InvalidChunkSize
,
ContextMismatch
({ expected : { section :
Str
, account :
Str
}, actual : { section :
Str
, account :
Str
} }),
NulCharacter
,
HeaderBeforeTerminator
,
MissingSection
,
InvalidFieldCode
(
U8
),
InvalidEncoding
({ encoding :
TextEncoding
, error :
EncodingError
})]
QIF
.
Error
:
Diagnostic
(
Problem
)
QIF
.
TextEncoding
:
TextEncoding
QIF
.
DateOrder
: [
RejectAmbiguous
,
MonthFirst
,
DayFirst
,
YearFirst
]
QIF
.
Props
:= { encoding :
TextEncoding
?? Utf8, date_order :
DateOrder
?? RejectAmbiguous, max_line_bytes :
U64
?? 1_048_576, max_record_bytes :
U64
?? 16_777_216, max_fields :
U64
?? 65_536, max_context_bytes :
U64
?? 65_536, errors :
RecoveryProps
?? {} }
QIF
.
Field
: { code :
U8
, value :
Str
}
QIF
.
Record
: { section :
Str
, account :
Str
, fields :
List
(
Field
), at :
Location
}
QIF
.
Event
: [
Header
(
Str
),
Record
(
Record
)]
QIF
.
Date
: { year :
U64
, month :
U64
, day :
U64
}
QIF
.
Split
: { category :
Str
, memo :
Str
, amount :
Str
}
QIF
.
Transaction
: { raw :
Record
, date :
Date
, amount :
Str
, payee :
Str
, memo :
Str
, number :
Str
, category :
Str
, cleared :
Str
, splits :
List
(
Split
) }
QIF
.
WriteProps
:= { encoding :
TextEncoding
?? Utf8, line_ending : [
Lf
,
CrLf
,
Cr
] ?? CrLf, max_record_bytes :
U64
?? 16_777_216, chunk_bytes :
U64
?? 65_536 }
QIF
.
ValidationProps
:= { source :
Str
, name :
Str
?? "<literal>", options :
Props
?? {} }
QIF
.
Decoder
:
Decoder
(
DecoderState
,
Event
, [
InvalidQif
(
Error
)])
QIF
.
TransactionEvent
: [
Header
(
Str
),
Account
(
Record
),
Context
(
Record
),
Transaction
(
Transaction
)]
QIF
.
TransactionDecoder
:
Decoder
(
DecoderState
,
TransactionEvent
, [
InvalidQif
(
Error
)])
RocSyntax
RocSyntax
.
from_quote
:
Str
->
Try
(
RocSyntax
, [
BadQuotedBytes
(
Str
)])
RocSyntax
.
validate
:
ValidateProps
->
Try
(
Parsed
, [
InvalidRocSyntax
(
Error
)])
RocSyntax
.
tokenize_bytes
:
List
(
U8
)
->
Tokenized
RocSyntax
.
tokenize_str
:
Str
->
Tokenized
RocSyntax
.
highlight_category
:
TokenKind
->
HighlightCategory
RocSyntax
.
parse_str
:
Str
,
Props
->
Parsed
RocSyntax
.
parse_bytes
:
List
(
U8
),
Props
->
Parsed
RocSyntax
.
Span
: { start :
U64
, end :
U64
}
RocSyntax
.
TokenKind
: [
Whitespace
,
Comment
,
LowerIdent
,
UpperIdent
,
Keyword
,
Number
,
StringStart
,
MultilineStringStart
,
StringPart
,
StringEnd
,
InterpolationStart
,
InterpolationEnd
,
SingleQuote
,
OpenRound
,
NoSpaceOpenRound
,
CloseRound
,
OpenSquare
,
CloseSquare
,
OpenCurly
,
CloseCurly
,
Operator
,
Punctuation
,
Invalid
,
EndOfFile
]
RocSyntax
.
Token
: { kind :
TokenKind
, start :
U64
, end :
U64
}
RocSyntax
.
NodeKind
: [
File
,
Declaration
,
VariableDeclaration
,
Expect
,
For
,
ForStream
,
While
,
ExpressionStatement
,
Lambda
,
If
,
Match
,
MatchBranch
,
Pattern
,
IdentifierPattern
,
WildcardPattern
,
PatternStringLiteral
,
CapturePattern
,
MutablePattern
,
TagPattern
,
NominalPattern
,
TuplePattern
,
ListPattern
,
RecordPattern
,
PatternField
,
RestPattern
,
AliasPattern
,
AlternativePattern
,
Block
,
Record
,
RecordUpdate
,
UnsetField
,
RecordBuilder
,
NominalRecord
,
NominalApply
,
RecordField
,
Header
,
Dependencies
,
DependencyField
,
PlatformReference
,
Import
,
FileImport
,
ImportPath
,
ImportAlias
,
ExposedItem
,
ExposedWildcard
,
TypeAnnotation
,
TypeExpression
,
Identifier
,
NumberLiteral
,
StringLiteral
,
MultilineStringLiteral
,
StringSegment
,
Interpolation
,
TypedLiteral
,
ArrowCall
,
MethodArrowCall
,
CharacterLiteral
,
Unary
,
Binary
,
Call
,
FieldAccess
,
OptionalFieldAccess
,
Suffix
,
Debug
,
Crash
,
Return
,
Break
,
Ellipsis
,
ListLiteral
,
Tuple
,
Parenthesized
,
ErrorNode
,
UnsupportedNode
,
TypeName
,
TypeVariable
,
TypeWildcard
,
TypeApply
,
TypeFunction
,
TypeTuple
,
TypeRecord
,
TypeField
,
TypeTagUnion
,
TypeExtension
,
TypeParenthesized
,
TypeDeclaration
,
TypeHeader
,
WhereClause
,
WhereMethod
,
WhereAlias
,
AssociatedBlock
,
PlatformRequires
,
RequiredValue
,
RequiredType
,
PlatformProvides
,
PlatformHosted
,
SymbolMapping
,
PlatformTargets
,
TargetInputsDirectory
,
TargetEntry
,
TargetConfig
,
TargetField
,
TargetList
,
TargetFile
]
RocSyntax
.
Node
: { kind :
NodeKind
, start :
U64
, end :
U64
, children_start :
U64
, children_len :
U64
}
RocSyntax
.
DiagnosticCode
: [
InvalidByte
,
InvalidUtf8
,
BidiControlInSource
,
Utf8ByteOrderMark
,
UnclosedString
,
UnclosedDelimiter
,
UnexpectedToken
,
InvalidNumber
,
InvalidEscape
,
InvalidCharacter
,
UnsupportedSyntax
,
ResourceLimit
]
RocSyntax
.
Diagnostic
:
Diagnostic
({ code :
DiagnosticCode
, span : { start :
U64
, end :
U64
} })
RocSyntax
.
Status
: [
Complete
,
Recovered
,
Unsupported
,
Limited
]
RocSyntax
.
Parsed
: { source :
List
(
U8
), tokens :
List
(
Token
), nodes :
List
(
Node
), children :
List
(
U64
), diagnostics :
List
(
Diagnostic
), status :
Status
, root :
U64
, consumed :
Bool
}
RocSyntax
.
LintProps
:= { placeholders :
Bool
?? True }
RocSyntax
.
ValidateProps
:= { source :
Str
, name :
Str
?? "<literal>", lints :
LintProps
?? {} }
RocSyntax
.
ValidationProblem
: [
Syntax
({ code :
DiagnosticCode
, span : { start :
U64
, end :
U64
} }),
PlaceholderExpression
,
Incomplete
(
Status
),
UnconsumedInput
]
RocSyntax
.
Error
:
Diagnostic
(
ValidationProblem
)
RocSyntax
.
Tokenized
: { source :
List
(
U8
), tokens :
List
(
Token
), diagnostics :
List
(
Diagnostic
), status :
Status
}
RocSyntax
.
HighlightCategory
: [
Trivia
,
CommentText
,
Name
,
TypeName
,
ReservedWord
,
NumericLiteral
,
StringText
,
Symbol
,
InvalidText
]
RocSyntax
.
Mode
: [
File
,
Expression
,
Statement
,
Header
]
RocSyntax
.
Props
:= { mode :
Mode
?? File }
Svg
Svg
.
parse_str
:
Str
,
Props
->
Try
(
Svg
, [
InvalidMarkup
(
Error
)])
Svg
.
parse_fragment
:
Str
,
Props
->
Try
(
Fragment
, [
InvalidMarkup
(
Error
)])
Svg
.
validate
:
ValidationProps
->
Try
(
Svg
, [
InvalidMarkup
(
Error
)])
Svg
.
from_quote
:
Str
->
Try
(
Svg
, [
BadQuotedBytes
(
Str
)])
Svg
.
parse_segments
:
List
(
Str
),
Props
->
Try
(
Plan
, [
InvalidMarkup
(
Error
)])
Svg
.
Path
:= { commands :
List
(
Command
) }
Svg.Path
.
is_eq
: _
Svg.Path
.
parse_str
:
Str
,
Props
->
Try
(
Path
, [
InvalidPath
(
Error
)])
Svg.Path
.
validate
:
Str
,
Props
->
Try
({}, [
InvalidPath
(
Error
)])
Svg.Path
.
from_quote
:
Str
->
Try
(
Path
, [
BadQuotedBytes
(
Str
)])
Svg.Path
.
Command
: { command :
U8
, arguments :
List
(
F64
), offset :
U64
}
Svg.Path
.
Problem
: [
MoveRequired
,
UnknownCommand
(
U8
),
ExpectedNumber
,
ExpectedFlag
,
NegativeRadius
,
IncompleteArguments
({ command :
U8
, expected :
U64
, actual :
U64
}),
UnexpectedComma
]
Svg.Path
.
Error
:
Diagnostic
(
Problem
)
Svg.Path
.
Props
:= {}
Svg
.
Props
:
Props
Svg
.
ValidationProps
:= { source :
Str
, name :
Str
?? "<literal>", options :
Props
?? {} }
Svg
.
Template
:= { bound :
Bound
(
a
) }
Svg.Template
.
from_interpolation
:
List
(
Str
)
->
Try
(
Iter
(
a
)
->
Template
(
a
), [
InvalidInterpolation
(
Str
)])
Svg.Template
.
from_quote
:
Str
->
Try
(
Template
(
a
), [
BadQuotedBytes
(
Str
)])
Svg
.
Fragment
:= { parsed :
Parsed
}
Svg.Fragment
.
validate
:
ValidationProps
->
Try
(
Fragment
, [
InvalidMarkup
(
Error
)])
Svg.Fragment
.
from_quote
:
Str
->
Try
(
Fragment
, [
BadQuotedBytes
(
Str
)])
Svg.Fragment
.
single_element
:
Fragment
->
Try
(
Node
, [
RootCount
(
U64
)])
Xml
Xml
.
is_eq
: _
Xml
.
to_hash
: _
Xml
.
decoder
: _
Xml
.
fold_source
: _
Xml
.
reader
: _
Xml
.
parse_str
:
Str
,
Props
->
Try
(
Xml
,
ReadError
)
Xml
.
parser
: {}
->
Parser
(
Bytes
,
Xml
,
Problem
)
Xml
.
validate
:
ValidationProps
->
Try
(
Xml
, [
InvalidXml
(
Error
)])
Xml
.
from_quote
:
Str
->
Try
(
Xml
, [
BadQuotedBytes
(
Str
)])
Xml
.
Namespaced
:= { declaration :
Try
(
Declaration
, [
Missing
]), root :
Node
}
Xml.Namespaced
.
is_eq
: _
Xml.Namespaced
.
to_hash
: _
Xml.Namespaced
.
parse_str
:
Str
,
Props
->
Try
(
Namespaced
,
ReadError
)
Xml.Namespaced
.
reader
:
Str
,
ReaderProps
->
Try
(
Reader
,
ReadError
)
Xml.Namespaced
.
decoder
:
StreamProps
->
Decoder
Xml.Namespaced
.
fold_source
: _
Xml.Namespaced
.
encode
:
Namespaced
,
WriteProps
->
Try
(
List
(
U8
), [
Unrenderable
(
Diagnostic
(
EncodeProblem
))])
Xml.Namespaced
.
xml_namespace
:
Str
Xml.Namespaced
.
xmlns_namespace
:
Str
Xml.Namespaced
.
Namespace
:
Namespace
Xml.Namespaced
.
Name
:
Name
Xml.Namespaced
.
Binding
:
Binding
Xml.Namespaced
.
Attribute
:
Attribute
Xml.Namespaced
.
Node
:= [
Element
({ name :
Name
, bindings :
List
(
Binding
), attributes :
List
(
Attribute
), children :
List
(
Node
) }),
Text
(
Str
)]
Xml.Namespaced.Node
.
is_eq
: _
Xml.Namespaced.Node
.
to_hash
: _
Xml.Namespaced.Node
.
name
:
Node
->
Try
(
Name
, [
NotAnElement
])
Xml.Namespaced.Node
.
attribute
:
Node
,
Namespace
,
Str
->
Try
(
Str
, [
Missing
])
Xml.Namespaced.Node
.
children_named
:
Node
,
Namespace
,
Str
->
List
(
Node
)
Xml.Namespaced.Node
.
text
:
Node
->
Str
Xml.Namespaced
.
Problem
:
Problem
Xml.Namespaced
.
NamespaceProblem
:
NamespaceProblem
Xml.Namespaced
.
ReadError
:
ReadError
Xml.Namespaced
.
StreamError
:
StreamError
Xml.Namespaced
.
Event
:
Event
Xml.Namespaced
.
Reader
Xml.Namespaced.Reader
.
next
:
Reader
->
[
Event
(
Event
,
Reader
),
Done
,
Failed
(
ReadError
)]
Xml.Namespaced.Reader
.
element
:
Reader
->
[
Element
(
Node
,
Reader
),
Failed
(
ReadError
),
NotAfterStart
]
Xml.Namespaced.Reader
.
metadata
:
Reader
->
Metadata
Xml.Namespaced
.
SourceAttribute
:
SourceAttribute
Xml.Namespaced
.
SourceEvent
:
SourceEvent
Xml.Namespaced
.
Decoder
:
Decoder
Xml.Namespaced
.
Metadata
:
Metadata
Xml.Namespaced
.
Props
:
Props
Xml.Namespaced
.
WriteProps
:= { declaration : [
Plain
,
Standalone
,
Omitted
] ?? Plain, prefixes : [
AsRead
,
Table
(
List
({ prefix :
Str
, namespace :
Str
}))] ?? AsRead, attribute_order :
AttributeOrder
?? AsGiven }
Xml.Namespaced
.
EncodeProblem
:
EncodeProblem
Xml.Namespaced
.
AttributeOrder
:
AttributeOrder
Xml
.
Lints
:= { non_utf8_declaration :
Bool
?? True }
Xml
.
ValidationProps
:= { source :
Str
, name :
Str
?? "<literal>", lints :
Lints
?? {} }
Xml
.
Attribute
:
Attribute
Xml
.
TextEncoding
:
TextEncoding
Xml
.
Declaration
:
Declaration
Xml
.
Version
:
Version
Xml
.
Node
:= [
Element
({ name :
Str
, attributes :
List
(
Attribute
), children :
List
(
Node
) }),
Text
(
Str
)]
Xml.Node
.
is_eq
: _
Xml.Node
.
to_hash
: _
Xml.Node
.
name
:
Node
->
Try
(
Str
, [
NotAnElement
])
Xml.Node
.
attribute
:
Node
,
Str
->
Try
(
Str
, [
Missing
])
Xml.Node
.
children_named
:
Node
,
Str
->
List
(
Node
)
Xml.Node
.
text
:
Node
->
Str
Xml
.
Problem
:
Problem
Xml
.
Construct
:
Construct
Xml
.
Error
:
Error
Xml
.
ReaderProps
:= { max_depth :
U64
?? 1024, max_elements :
U64
?? 4_194_304, max_attributes :
U64
?? 1024, namespaces :
Bool
?? False }
Xml
.
Props
:= { limits : [
Unbounded
,
Bounded
(
ReaderProps
)] ?? Unbounded }
Xml
.
Limit
:
Limit
Xml
.
ReadError
:
ReadError
Xml
.
StreamProps
:= { max_depth :
U64
?? 1024, max_elements :
U64
?? 4_194_304, max_attributes :
U64
?? 1024, max_token_bytes :
U64
?? 65_536, max_text_bytes :
U64
?? 65_536, max_context_bytes :
U64
?? 4_194_304, namespaces :
Bool
?? False, errors :
RecoveryProps
?? {} }
Xml
.
StreamError
:
StreamError
Xml
.
Metadata
:
Metadata
Xml
.
Decoder
:
Decoder
Xml
.
SourceSpan
:
SourceSpan
Xml
.
SourceStart
:
SourceStart
Xml
.
SourceEvent
:
SourceEvent
Xml
.
Event
:
Event
Xml
.
Reader
Xml.Reader
.
next
:
Reader
->
[
Event
(
Event
,
Reader
),
Done
,
Failed
(
ReadError
)]
Xml.Reader
.
element
:
Reader
->
[
Element
(
Node
,
Reader
),
Failed
(
ReadError
),
NotAfterStart
]
Xml.Reader
.
element_with
:
Reader
, { context :
ctx
, first :
open
, start :
ctx
,
Str
,
List
(
Attribute
)
->
Try
({ context :
ctx
, open :
open
},
err
), text :
Str
->
node
, end :
ctx
,
open
,
List
(
node
)
->
{ context :
ctx
, node :
node
} }
->
[
Element
(
node
,
ctx
,
Reader
),
Failed
(
ReadError
),
Rejected
(
err
,
Location
),
NotAfterStart
]
Xml.Reader
.
metadata
:
Reader
->
Metadata
Yaml
Yaml
.
tokenize_str
:
Str
->
Tokenized
Yaml
.
tokenize_bytes
:
List
(
U8
)
->
Tokenized
Yaml
.
highlight_category
:
Token
->
HighlightCategory
Yaml
.
is_eq
: _
Yaml
.
to_hash
: _
Yaml
.
from_quote
:
Str
->
Try
(
Yaml
, [
BadQuotedBytes
(
Str
)])
Yaml
.
validate
:
ValidationProps
->
Try
(
Yaml
, [
InvalidYaml
(
Error
)])
Yaml
.
validate_as
:
DecodeValidationProps
->
Try
(
a
, [
InvalidYaml
(
Error
), ..
errs
])
where
[
a
.
Parseable
([
InvalidYaml
(
Error
), ..
errs
])]
Yaml
.
parse_str
:
Str
,
Props
->
Try
(
Yaml
, [
InvalidYaml
(
Error
)])
Yaml
.
parser
:
Props
->
Parser
(
Bytes
,
Yaml
,
Problem
)
Yaml
.
get
:
Yaml
,
Str
->
Try
(
Yaml
, [
Missing
])
Yaml
.
at
:
Yaml
,
U64
->
Try
(
Yaml
, [
Missing
])
Yaml
.
get_path
:
Yaml
,
List
(
Str
)
->
Try
(
Yaml
, [
Missing
])
Yaml
.
as_str
:
Yaml
->
Try
(
Str
, [
WrongType
])
Yaml
.
as_i64
:
Yaml
->
Try
(
I64
, [
WrongType
])
Yaml
.
as_bool
:
Yaml
->
Try
(
Bool
, [
WrongType
])
Yaml
.
as_list
:
Yaml
->
Try
(
List
(
Yaml
), [
WrongType
])
Yaml
.
to_inspect
:
Yaml
->
Str
Yaml
.
decode_str
:
Str
,
DecodeProps
->
Try
(
a
, [
InvalidYaml
(
Error
), ..
errs
])
where
[
a
.
Parseable
([
InvalidYaml
(
Error
), ..
errs
])]
Yaml
.
value_parser
:
DecodeProps
->
Parser
(
Bytes
,
a
, [
InvalidYaml
(
Error
), ..
errs
])
where
[
a
.
Parseable
([
InvalidYaml
(
Error
), ..
errs
])]
Yaml
.
Expected
: [
StringValue
,
BooleanValue
,
TagName
,
SequenceValue
,
SequenceLength
(
U64
),
MappingKey
,
MappingValue
,
IntegerValue
,
NumberValue
]
Yaml
.
Actual
: [
SequenceValue
,
MappingValue
,
MappingKey
(
Str
),
QuotedScalar
(
Str
),
PlainScalar
(
Str
),
NullValue
]
Yaml
.
NumericType
: [
U8
,
I8
,
U16
,
I16
,
U32
,
I32
,
U64
,
I64
,
U128
,
I128
,
F32
,
F64
,
Dec
]
Yaml
.
Resource
: [
NestingDepth
]
Yaml
.
Problem
: [
TypeMismatch
({ expected :
Expected
, actual :
Actual
}),
ExpectedNull
,
TagPayloadUnsupported
,
UnknownTag
(
Str
),
UnknownKey
(
Str
),
WrongSequenceLength
({ expected :
U64
, actual :
U64
}),
UndecodableValue
,
MissingRequiredField
(
Str
),
LegacyBoolean
(
Str
),
ExpectedValue
,
TabIndentation
,
IndentedRoot
,
TrailingContent
,
UnexpectedEnd
,
InvalidCharacter
(
Excerpt
),
LimitExceeded
({ resource :
Resource
, max :
U64
, observed :
Observed
}),
UnexpectedIndentation
,
DuplicateKey
(
Str
),
MultilinePlainScalarUnsupported
,
UnexpectedSequenceIndentation
,
InvalidBlockHeader
,
DuplicateChompingIndicator
,
DuplicateIndentIndicator
,
UnsupportedBlockHeader
,
OverindentedLeadingEmptyLines
,
BlockScalarPlacement
,
ReferencesUnsupported
,
DirectivesUnsupported
,
ComplexKeysUnsupported
,
InvalidScalarStart
(
U8
),
IndicatorBeforeWhitespace
,
UnexpectedMappingValue
,
IntegerOutOfRange
({ value :
Str
, target :
NumericType
}),
NumberOutOfRange
({ value :
Str
, target :
NumericType
}),
ExpectedFlowEntry
,
EmptyKey
,
InvalidKeyStart
(
U8
),
UnclosedQuote
(
U8
),
TrailingQuotedContent
(
U8
),
UndoubledQuote
,
InvalidEscape
(
Str
),
UnclosedEscape
,
InvalidHexEscape
(
U64
),
SurrogateEscape
(
U32
),
InvalidUnicodeEscape
(
U32
),
CollectionOnDocumentStart
,
MultipleDocumentsUnsupported
,
EmptyFlowItem
,
UnexpectedClosingBracket
,
UnexpectedClosingBrace
,
UnclosedFlowQuote
,
UnclosedNestedFlowCollection
,
UnclosedFlowCollection
]
Yaml
.
Error
:
Diagnostic
(
Problem
)
Yaml
.
Span
: { start :
U64
, end :
U64
}
Yaml
.
TokenKind
: [
Whitespace
,
Comment
,
PlainScalar
,
SingleQuotedScalar
,
DoubleQuotedScalar
,
MappingValue
,
SequenceEntry
,
ExplicitKey
,
FlowSequenceStart
,
FlowSequenceEnd
,
FlowMappingStart
,
FlowMappingEnd
,
FlowEntry
,
BlockScalarHeader
,
BlockScalarContent
,
Anchor
,
Alias
,
Tag
,
Directive
,
DocumentStart
,
DocumentEnd
,
Invalid
]
Yaml
.
TokenRole
: [
Key
,
Value
,
Other
]
Yaml
.
ScalarCategory
: [
Text
,
Boolean
,
Null
,
Number
]
Yaml
.
Token
: { kind :
TokenKind
, start :
U64
, end :
U64
, role :
TokenRole
, scalar :
ScalarCategory
}
Yaml
.
DiagnosticCode
: [
UnclosedQuote
,
InvalidEscape
,
UnclosedCollection
,
UnexpectedDelimiter
,
InvalidIndentation
,
InvalidBlockHeader
,
InvalidCharacter
,
InvalidUtf8
,
ResourceLimit
]
Yaml
.
Diagnostic
: { code :
DiagnosticCode
, start :
U64
, end :
U64
}
Yaml
.
TokenStatus
: [
Complete
,
Recovered
,
Limited
]
Yaml
.
Tokenized
: { source :
List
(
U8
), tokens :
List
(
Token
), diagnostics :
List
(
Diagnostic
), status :
TokenStatus
}
Yaml
.
HighlightCategory
: [
Trivia
,
CommentText
,
PropertyName
,
StringText
,
NumericLiteral
,
BooleanLiteral
,
NullLiteral
,
Symbol
,
Name
,
TypeName
,
InvalidText
]
Yaml
.
Lints
:= { legacy_booleans :
Bool
?? True }
Yaml
.
ValidationProps
:= { source :
Str
, name :
Str
?? "<literal>", lints :
Lints
?? {} }
Yaml
.
DecodeValidationProps
:= { source :
Str
, name :
Str
?? "<literal>", lints :
Lints
?? {}, keys : [
SnakeCase
,
KebabCase
,
CamelCase
] ?? SnakeCase, unknown_keys : [
Skip
,
Reject
] ?? Skip }
Yaml
.
Decoded
:= { value :
a
}
Yaml.Decoded
.
from_quote
:
Str
->
Try
(
Decoded
(
a
), [
BadQuotedBytes
(
Str
)])
where
[
a
.
Parseable
([
InvalidYaml
(
Error
), ..
errs
])]
Yaml
.
Props
:= { validation : [
SyntaxOnly
,
Checked
(
Lints
)] ?? SyntaxOnly }
Yaml
.
DecodeProps
:= { keys : [
SnakeCase
,
KebabCase
,
CamelCase
] ?? SnakeCase, unknown_keys : [
Skip
,
Reject
] ?? Skip }
Yaml
.
Parseable
:
a
where
[
a
.parser_for :
Format
(
errs
)
->
(
Cursor
->
Try
({ value :
a
, rest :
Cursor
},
errs
))]
Yaml
.
Format
Yaml.Format
.
rename_field
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Str
->
Str
Yaml.Format
.
parse_str
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
Str
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_bool
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
Bool
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_u8
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
U8
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_i8
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
I8
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_u16
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
U16
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_i16
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
I16
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_u32
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
U32
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_i32
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
I32
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_u64
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
U64
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_i64
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
I64
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_u128
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
U128
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_i128
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
I128
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_dec
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
Dec
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_f32
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
F32
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_f64
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
F64
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_null
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
(
Cursor
, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
missing_field
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Str
->
[
InvalidYaml
(
Error
), ..
errors
]
Yaml.Format
.
parse_tag_union
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
ParseTagUnionSpec
(
a
,
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
, [
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
a
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_list_start
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
([
Counted
({ len :
U64
, rest :
Cursor
}),
Uncounted
(
Cursor
)], [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_list_next
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
([
Item
(
Cursor
),
Done
(
Cursor
)], [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_list_after_item
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
([
Continue
(
Cursor
),
Done
(
Cursor
)], [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_tuple_start
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
,
U64
->
Try
(
Cursor
, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_tuple_next
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
,
U64
,
U64
->
Try
(
Cursor
, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_tuple_end
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
,
U64
->
Try
(
Cursor
, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_record_start
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
([
Counted
({ len :
U64
, rest :
Cursor
}),
Uncounted
(
Cursor
)], [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_record_field
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
FieldNames
(
_shape
),
Cursor
->
Try
([
Field
({ field :
FieldName
(
_shape
), rest :
Cursor
}),
TryField
({ name :
Str
, rest :
Cursor
}),
TryFieldCaseless
({ name :
Str
, rest :
Cursor
}),
Continue
(
Cursor
),
Done
(
Cursor
)], [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_record_after_field
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
([
Continue
(
Cursor
),
Done
(
Cursor
)], [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
skip_record_field
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
(
Cursor
, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_dict_start
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
([
Counted
({ len :
U64
, rest :
Cursor
}),
Uncounted
(
Cursor
)], [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_dict_next
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
([
Entry
(
Cursor
),
Done
(
Cursor
)], [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_dict_after_key
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
(
Cursor
, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_dict_after_entry
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
([
Continue
(
Cursor
),
Done
(
Cursor
)], [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
invalid_value
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
[
InvalidYaml
(
Error
), ..
errors
]
Yaml.Format
.
parse_key_str
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
Str
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_key_u8
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
U8
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_key_i8
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
I8
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_key_u16
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
U16
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_key_i16
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
I16
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_key_u32
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
U32
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_key_i32
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
I32
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_key_u64
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
U64
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml.Format
.
parse_key_i64
:
Format
([
InvalidYaml
(
Error
), ..
errors
]),
Cursor
->
Try
({ value :
I64
, rest :
Cursor
}, [
InvalidYaml
(
Error
), ..
errors
])
Yaml
.
Cursor