HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Moduleyesod-core-1.7.0.0Haskell2010

Yesod.Core.Content

  • 8 types
  • 4 classes
  • 22 values

Content

4 declarations
datadata Content
#

Constructors

Instances4IsString, ToContent, ToTypedContent
classclass ToContent a where
#

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

Instances24ToContent, …
classclass ToFlushBuilder a where
#

A class for all data which can be sent in a streaming response. Note that for textual data, instances must use UTF-8 encoding.

Since 1.2.0

Instances14ToFlushBuilder, …

Mime types

0 declarations

Data type

Utilities

3 declarations

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".

Represents TypedContent as a String, rendering at most a specified number of bytes of the content, and annotating it with the remaining length. Returns Nothing if the content type indicates the content is binary data.

Evaluation strategy

1 declaration
newtypenewtype DontFullyEvaluate a
#

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

Since 1.1.0

Instances3HasContentType, ToContent, ToTypedContent

Representations

3 declarations
classclass ToContent a => ToTypedContent a where
#

Any type which can be converted to TypedContent.

Since 1.2.0

Instances17ToTypedContent, …
classclass ToTypedContent a => HasContentType a where
#

Methods

Instances12HasContentType, …

Specific content types

typetype RepHtml = Html
#

Deprecated. Please use Html instead

Smart constructors