 }
 
 /**
-This function is documented with the FilterFunction type.
-
-:see: FilterFunction
+Builds a filter that performs post rendering.
+
+`Rendering` is a type that wraps a rendered String, and its ContentType (HTML or
+Text). This filter turns a rendering in another one:
+
+    // twice filter renders its argument twice:
+    let twice = Filter { (rendering: Rendering, _) in
+        return Rendering(rendering.string + rendering.string, rendering.contentType)
+    }
+
+    let template = Template(string: "{{ twice(x) }}")!
+    template.registerInBaseContext("twice", Box(twice))
+
+    // Renders "foofoo", "123123"
+    template.render(Box(["x": "foo"]))!
+    template.render(Box(["x": 123]))!
+
+Beware that when this filter is executed, eventual HTML-escaping has not
+happened yet: the rendering argument may contain raw text.
 */
 public func Filter(filter: (Rendering, NSErrorPointer) -> Rendering?) -> FilterFunction {
     return { (box: MustacheBox, partialApplication: Bool, error: NSErrorPointer) in

    template.render(Box(["x": 10.0]))!

If the template argument evaluates to a missing value, or a value which is not
not convertible to Double, the filter returns an error of domain
`GRMustacheErrorDomain` and code `GRMustacheErrorCodeRenderingError`:

    // Error evaluating {{increment(x)}} at line 1: Unexpected argument
    var error: NSError?
    template.render(Box(), error: &error)
    template.render(Box(["x": "foo"]), error: &error)

Values which are convertible to Double are:
    
    // "100"
    template.render(Box(["x": 10]))!                    // Int
    template.render(Box(["x": 10 as UInt]))!            // UInt
    template.render(Box(["x": 10.0]))!                  // Double
    template.render(Box(["x": NSNumber(integer: 10)]))! // NSNumber
    // "1"
    template.render(Box(["x": NSNumber(bool: true)]))!  // NSNumber (continued)
    template.render(Box(["x": true]))!                  // Bool

If the filter is given several arguments, an error of domain
`GRMustacheErrorDomain` and code `GRMustacheErrorCodeRenderingError` is returned
when the template is rendered.

:param: a function that turns an integer into a MustacheBox
:returns: a FilterFunction
*/
public func Filter(filter: (Double, NSErrorPointer) -> MustacheBox?) -> FilterFunction {

}

/**
Builds a filter that takes a single argument of type `T` and performs custom
rendering.

If the template argument evaluates to a missing value, or a value which is not
of type T, the filter returns an error of domain `GRMustacheErrorDomain` and
code `GRMustacheErrorCodeRenderingError`.

If the template provides more than one argument, the filter returns an error of
domain `GRMustacheErrorDomain` and code `GRMustacheErrorCodeRenderingError`.

See the documentation of the `RenderFunction` type for a detailed discussion of
the `RenderingInfo` and `Rendering` types.

For an example of such a filter, see the documentation of
`func Filter(filter: (Int, RenderingInfo, NSErrorPointer) -> Rendering?) -> FilterFunction`.
This example processes `Int` instead of `T`, but the idea is the same.

:param: filter a function `(T, RenderingInfo, NSErrorPointer) -> Rendering?`
:returns: a FilterFunction
*/
public func Filter<T>(filter: (T, RenderingInfo, NSErrorPointer) -> Rendering?) -> FilterFunction {
    return Filter { (t: T, error: NSErrorPointer) in
        // Box a RenderFunction
        return Box { (info: RenderingInfo, error: NSErrorPointer) in
            return filter(t, info, error)
        }
