    {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
    module Text.StringTemplate.Renderf ((|=), SEType(..)) where
    import Text.StringTemplate.Base

    class Stringable b => SEType b a where
        renderf :: StringTemplate b -> a
    instance Stringable a => SEType a a where
        renderf :: StringTemplate a -> a
    renderf = StringTemplate a -> a
    forall a. Stringable a => StringTemplate a -> a
    render
    instance Stringable a => SEType a (StringTemplate a) where
        renderf :: StringTemplate a -> StringTemplate a
    renderf = StringTemplate a -> StringTemplate a
    forall a. a -> a
    id
    instance (ToSElem a, SEType b r) => SEType b ((String, a) -> r) where
        renderf :: StringTemplate b -> (String, a) -> r
    renderf StringTemplate b
    x (String
    k, a
    v) = StringTemplate b -> r
    forall b a. SEType b a => StringTemplate b -> a
    renderf (StringTemplate b -> r) -> StringTemplate b -> r
    forall a b. (a -> b) -> a -> b
    $ String -> a -> StringTemplate b -> StringTemplate b
    forall a b.
    (ToSElem a, Stringable b) =>
    String -> a -> StringTemplate b -> StringTemplate b
    setAttribute String
    k a
    v StringTemplate b
    x

    (|=) :: (Monad m) => a -> m a1 -> m (a, a1)
    a
    k |= :: forall (m :: * -> *) a a1. Monad m => a -> m a1 -> m (a, a1)
    |= m a1
    v = (a, a1) -> m (a, a1)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ((a, a1) -> m (a, a1)) -> (a1 -> (a, a1)) -> a1 -> m (a, a1)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (,) a
    k (a1 -> m (a, a1)) -> m a1 -> m (a, a1)
    forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
    =<< m a1
    v
    infixl 5 |=