yesod-core-1.2.11: Creation of type-safe, RESTful web applications.

Safe HaskellNone

Yesod.Core.Content

Contents

Synopsis

Content

emptyContent :: ContentSource

Zero-length enumerator.

class ToContent a whereSource

Anything which can be converted into Content. Most of the time, you will want to use the ContentBuilder constructor. An easier approach will be to use a pre-defined toContent function, such as converting your data into a lazy bytestring and then calling toContent on that.

Please note that the built-in instances for lazy data structures (String, lazy ByteString, lazy Text and Html) will not automatically include the content length for the ContentBuilder constructor.

Methods

toContent :: a -> ContentSource

Mime types

Data type

Utilities

simpleContentType :: ContentType -> ContentTypeSource

Removes "extra" information at the end of a content type string. In particular, removes everything after the semicolon, if present.

For example, "text/html; charset=utf-8" is commonly used to specify the character encoding for HTML data. This function would return "text/html".

Evaluation strategy

newtype DontFullyEvaluate a Source

Prevents a response body from being fully evaluated before sending the request.

Since 1.1.0

Constructors

DontFullyEvaluate 

Fields

unDontFullyEvaluate :: a
 

Representations

Specific content types

type RepHtml = HtmlSource

Deprecated: Please use Html instead

Smart constructors