Z-YAML-0.1.0.0: YAML tools
Copyright(c) Dong Han 2020
LicenseBSD
Maintainerwinterland1989@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Z.Data.YAML.FFI

Description

LibYAML bindings, which provide streaming YAML read & write.

Synopsis

The event stream

data MarkedEvent Source #

Constructors

MarkedEvent 

Fields

Instances

Instances details
Eq MarkedEvent Source # 
Instance details

Defined in Z.Data.YAML.FFI

Ord MarkedEvent Source # 
Instance details

Defined in Z.Data.YAML.FFI

Show MarkedEvent Source # 
Instance details

Defined in Z.Data.YAML.FFI

Generic MarkedEvent Source # 
Instance details

Defined in Z.Data.YAML.FFI

Associated Types

type Rep MarkedEvent :: Type -> Type #

ToValue MarkedEvent Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

toValue :: MarkedEvent -> Value #

EncodeJSON MarkedEvent Source # 
Instance details

Defined in Z.Data.YAML.FFI

FromValue MarkedEvent Source # 
Instance details

Defined in Z.Data.YAML.FFI

ShowT MarkedEvent Source # 
Instance details

Defined in Z.Data.YAML.FFI

type Rep MarkedEvent Source # 
Instance details

Defined in Z.Data.YAML.FFI

type Rep MarkedEvent = D1 ('MetaData "MarkedEvent" "Z.Data.YAML.FFI" "Z-YAML-0.1.0.0-9s3yJPeTIfnHYFQzctMYUL" 'False) (C1 ('MetaCons "MarkedEvent" 'PrefixI 'True) (S1 ('MetaSel ('Just "markedEvent") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Event) :*: (S1 ('MetaSel ('Just "startMark") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Mark) :*: S1 ('MetaSel ('Just "endMark") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Mark))))

data Mark Source #

The pointer position

Constructors

Mark 

Fields

Instances

Instances details
Eq Mark Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

(==) :: Mark -> Mark -> Bool #

(/=) :: Mark -> Mark -> Bool #

Ord Mark Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

compare :: Mark -> Mark -> Ordering #

(<) :: Mark -> Mark -> Bool #

(<=) :: Mark -> Mark -> Bool #

(>) :: Mark -> Mark -> Bool #

(>=) :: Mark -> Mark -> Bool #

max :: Mark -> Mark -> Mark #

min :: Mark -> Mark -> Mark #

Show Mark Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

showsPrec :: Int -> Mark -> ShowS #

show :: Mark -> String #

showList :: [Mark] -> ShowS #

Generic Mark Source # 
Instance details

Defined in Z.Data.YAML.FFI

Associated Types

type Rep Mark :: Type -> Type #

Methods

from :: Mark -> Rep Mark x #

to :: Rep Mark x -> Mark #

ToValue Mark Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

toValue :: Mark -> Value #

EncodeJSON Mark Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

encodeJSON :: Mark -> Builder () #

FromValue Mark Source # 
Instance details

Defined in Z.Data.YAML.FFI

ShowT Mark Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

toUTF8BuilderP :: Int -> Mark -> Builder () #

type Rep Mark Source # 
Instance details

Defined in Z.Data.YAML.FFI

type Rep Mark = D1 ('MetaData "Mark" "Z.Data.YAML.FFI" "Z-YAML-0.1.0.0-9s3yJPeTIfnHYFQzctMYUL" 'False) (C1 ('MetaCons "Mark" 'PrefixI 'True) (S1 ('MetaSel ('Just "yamlIndex") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: (S1 ('MetaSel ('Just "yamlLine") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "yamlColumn") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Int))))

data Event Source #

Instances

Instances details
Eq Event Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

(==) :: Event -> Event -> Bool #

(/=) :: Event -> Event -> Bool #

Ord Event Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

compare :: Event -> Event -> Ordering #

(<) :: Event -> Event -> Bool #

(<=) :: Event -> Event -> Bool #

(>) :: Event -> Event -> Bool #

(>=) :: Event -> Event -> Bool #

max :: Event -> Event -> Event #

min :: Event -> Event -> Event #

Show Event Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

showsPrec :: Int -> Event -> ShowS #

show :: Event -> String #

showList :: [Event] -> ShowS #

Generic Event Source # 
Instance details

Defined in Z.Data.YAML.FFI

Associated Types

type Rep Event :: Type -> Type #

Methods

from :: Event -> Rep Event x #

to :: Rep Event x -> Event #

ToValue Event Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

toValue :: Event -> Value #

EncodeJSON Event Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

encodeJSON :: Event -> Builder () #

FromValue Event Source # 
Instance details

Defined in Z.Data.YAML.FFI

ShowT Event Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

toUTF8BuilderP :: Int -> Event -> Builder () #

type Rep Event Source # 
Instance details

Defined in Z.Data.YAML.FFI

type Rep Event = D1 ('MetaData "Event" "Z.Data.YAML.FFI" "Z-YAML-0.1.0.0-9s3yJPeTIfnHYFQzctMYUL" 'False) (((C1 ('MetaCons "EventStreamStart" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EventStreamEnd" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "EventDocumentStart" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "EventDocumentEnd" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EventAlias" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Anchor))))) :+: ((C1 ('MetaCons "EventScalar" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Anchor) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Tag) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ScalarStyle))) :+: C1 ('MetaCons "EventSequenceStart" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Anchor) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Tag) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SequenceStyle)))) :+: (C1 ('MetaCons "EventSequenceEnd" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "EventMappingStart" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Anchor) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Tag) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 MappingStyle))) :+: C1 ('MetaCons "EventMappingEnd" 'PrefixI 'False) (U1 :: Type -> Type)))))

data Tag Source #

Instances

Instances details
Eq Tag Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

(==) :: Tag -> Tag -> Bool #

(/=) :: Tag -> Tag -> Bool #

Ord Tag Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

compare :: Tag -> Tag -> Ordering #

(<) :: Tag -> Tag -> Bool #

(<=) :: Tag -> Tag -> Bool #

(>) :: Tag -> Tag -> Bool #

(>=) :: Tag -> Tag -> Bool #

max :: Tag -> Tag -> Tag #

min :: Tag -> Tag -> Tag #

Show Tag Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

showsPrec :: Int -> Tag -> ShowS #

show :: Tag -> String #

showList :: [Tag] -> ShowS #

Generic Tag Source # 
Instance details

Defined in Z.Data.YAML.FFI

Associated Types

type Rep Tag :: Type -> Type #

Methods

from :: Tag -> Rep Tag x #

to :: Rep Tag x -> Tag #

ToValue Tag Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

toValue :: Tag -> Value #

EncodeJSON Tag Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

encodeJSON :: Tag -> Builder () #

FromValue Tag Source # 
Instance details

Defined in Z.Data.YAML.FFI

ShowT Tag Source # 
Instance details

Defined in Z.Data.YAML.FFI

Methods

toUTF8BuilderP :: Int -> Tag -> Builder () #

type Rep Tag Source # 
Instance details

Defined in Z.Data.YAML.FFI

type Rep Tag = D1 ('MetaData "Tag" "Z.Data.YAML.FFI" "Z-YAML-0.1.0.0-9s3yJPeTIfnHYFQzctMYUL" 'False) (((C1 ('MetaCons "StrTag" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FloatTag" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "NullTag" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "BoolTag" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SetTag" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "IntTag" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SeqTag" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MapTag" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "UriTag" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "NoTag" 'PrefixI 'False) (U1 :: Type -> Type)))))

Decoding

initParser :: HasCallStack => Bytes -> Resource (Source MarkedEvent) Source #

Create a source that yields marked events from a piece of YAML bytes.

initFileParser :: HasCallStack => CBytes -> Resource (Source MarkedEvent) Source #

Create a source that yields marked events from a piece of YAML bytes.

Encoding

data YAMLFormatOpts Source #

Contains options relating to the formatting (indendation, width) of the YAML output.

Constructors

YAMLFormatOpts 

Fields

initEmitter :: HasCallStack => YAMLFormatOpts -> Resource (Ptr EmitterStruct, Sink Event) Source #

Make a new YAML event sink, whose result can be fetched via getEmitterResult.

initFileEmitter :: HasCallStack => YAMLFormatOpts -> CBytes -> Resource (Sink Event) Source #

Make a new YAML event sink, whose result are written to a file.

Note the file will be opened in O_APPEND .|. O_CREAT .|. O_WRONLY mode, bytes will be written after the end of the original file if there'are old bytes.

getEmitterResult :: Ptr EmitterStruct -> IO Text Source #

Fetch YAML emitter's building buffer.

renderScalarTags :: Event -> TagRender Source #

A value for formatOptionsRenderTags that renders no collection tags but all scalar tags (unless suppressed with styles 'NoTag or PlainNoTag).

renderAllTags :: Event -> TagRender Source #

A value for formatOptionsRenderTags that renders all tags (except NoTag tag and PlainNoTag style).

renderNoTags :: Event -> TagRender Source #

A value for formatOptionsRenderTags that renders no tags.

renderUriTags :: Event -> TagRender Source #

Constants

type ScalarStyle = CInt Source #

Style for scalars - e.g. quoted / folded

pattern Any :: ScalarStyle Source #

type SequenceStyle = CInt Source #

Style for sequences - e.g. block or flow

type MappingStyle = CInt Source #

Style for mappings - e.g. block or flow

Exception type