mime-directory-0.1: A library for parsing/printing the text/directory mime type.

Codec.MIME.ContentType.Text.Directory

Synopsis

Documentation

data Property u Source

Constructors

Prop 

Instances

Show u => Show (Property u) 

data Type Source

Constructors

Type 

Instances

data Parameter Source

Constructors

Param 

Instances

data Value u Source

Instances

Eq u => Eq (Value u) 
Show u => Show (Value u) 
PrintValue u => PrintValue (Value u) 

data Rfc2425Types Source

Instantiate Value with this phantom type to indicate that property types should be none other than those defined in rfc2425.

Instances

type ValueParser u = (Type, [Parameter]) -> ByteString -> [Value u]Source

The type of parsers for property values, for instance to read an integer property, text property, etc.

nakedType :: ByteString -> TypeSource

Make a property type without any grouping.

(@@) :: Property u -> ByteString -> BoolSource

Check whether the given property is an instance of the given type.

parseDirectorySource

Arguments

:: ValueParser u

Given a Property Type and a list of parameters, parse a string representation into a Value.

-> ByteString 
-> Directory u 

pa_text :: ValueParser uSource

Unescape slashes, newlines and commas.

many :: ValueParser u -> ValueParser uSource

Take a parser for single values to a parser for a list of values. This assumes that the separator between values is the , character, and that values do not contain commas themselves.

printDirectory :: PrintValue u => [Property u] -> ByteStringSource

printProperty :: PrintValue u => Property u -> ByteStringSource