    -- |
    -- Module      :  Text.Microstache.Type
    -- Copyright   :  © 2016–2017 Stack Buliders
    -- License     :  BSD 3 clause
    --
    -- Maintainer  :  Mark Karpov <markkarpov@openmailbox.org>
    -- Stability   :  experimental
    -- Portability :  portable
    --
    -- Types used by the package. You don't usually need to import the module,
    -- because "Text.Microstache" re-exports everything you may need, import that
    -- module instead.

    {-# LANGUAGE DeriveDataTypeable         #-}
    {-# LANGUAGE DeriveGeneric              #-}
    {-# LANGUAGE GeneralizedNewtypeDeriving #-}
    {-# LANGUAGE OverloadedStrings          #-}

    module Text.Microstache.Type
      ( Template (..)
      , Node (..)
      , Key (..)
      , showKey
      , PName (..)
      , MustacheException (..)
      , displayMustacheException
      , MustacheWarning (..)
      , displayMustacheWarning
      )
    where

    import Control.DeepSeq   (NFData (..))
    import Control.Exception (Exception (..))
    import Data.Data         (Data)
    import Data.Map          (Map)
    import Data.Monoid       (Monoid (..))
    import Data.Semigroup    (Semigroup (..))
    import Data.String       (IsString (..))
    import Data.Text         (Text)
    import Data.Typeable     (Typeable)
    import Data.Word         (Word)
    import GHC.Generics
    import Text.Parsec       (ParseError)

    import qualified Data.Map  as Map
    import qualified Data.Text as T

    -- | Mustache template as name of “top-level” template and a collection of
    -- all available templates (partials).
    --
    -- 'Template' is a 'Semigroup'. This means that you can combine 'Template's
    -- (and their caches) using the @('<>')@ operator, the resulting 'Template'
    -- will have the same currently selected template as the left one. Union of
    -- caches is also left-biased.

    data Template = Template
      { Template -> PName
    templateActual :: PName
        -- ^ Name of currently “selected” template (top-level one).
      , Template -> Map PName [Node]
    templateCache  :: Map PName [Node]
        -- ^ Collection of all templates that are available for interpolation
        -- (as partials). The top-level one is also contained here and the
        -- “focus” can be switched easily by modifying 'templateActual'.
      } deriving (Template -> Template -> Bool
    (Template -> Template -> Bool)
    -> (Template -> Template -> Bool) -> Eq Template
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Template -> Template -> Bool
    == :: Template -> Template -> Bool
    $c/= :: Template -> Template -> Bool
    /= :: Template -> Template -> Bool
    Eq, Eq Template
    Eq Template =>
    (Template -> Template -> Ordering)
    -> (Template -> Template -> Bool)
    -> (Template -> Template -> Bool)
    -> (Template -> Template -> Bool)
    -> (Template -> Template -> Bool)
    -> (Template -> Template -> Template)
    -> (Template -> Template -> Template)
    -> Ord Template
    Template -> Template -> Bool
    Template -> Template -> Ordering
    Template -> Template -> Template
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: Template -> Template -> Ordering
    compare :: Template -> Template -> Ordering
    $c< :: Template -> Template -> Bool
    < :: Template -> Template -> Bool
    $c<= :: Template -> Template -> Bool
    <= :: Template -> Template -> Bool
    $c> :: Template -> Template -> Bool
    > :: Template -> Template -> Bool
    $c>= :: Template -> Template -> Bool
    >= :: Template -> Template -> Bool
    $cmax :: Template -> Template -> Template
    max :: Template -> Template -> Template
    $cmin :: Template -> Template -> Template
    min :: Template -> Template -> Template
    Ord, Int -> Template -> ShowS
    [Template] -> ShowS
    Template -> [Char]
    (Int -> Template -> ShowS)
    -> (Template -> [Char]) -> ([Template] -> ShowS) -> Show Template
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Template -> ShowS
    showsPrec :: Int -> Template -> ShowS
    $cshow :: Template -> [Char]
    show :: Template -> [Char]
    $cshowList :: [Template] -> ShowS
    showList :: [Template] -> ShowS
    Show, Typeable Template
    Typeable Template =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> Template -> c Template)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c Template)
    -> (Template -> Constr)
    -> (Template -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c Template))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Template))
    -> ((forall b. Data b => b -> b) -> Template -> Template)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> Template -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> Template -> r)
    -> (forall u. (forall d. Data d => d -> u) -> Template -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> Template -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> Template -> m Template)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Template -> m Template)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Template -> m Template)
    -> Data Template
    Template -> Constr
    Template -> DataType
    (forall b. Data b => b -> b) -> Template -> Template
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> Template -> u
    forall u. (forall d. Data d => d -> u) -> Template -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Template -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Template -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Template -> m Template
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Template -> m Template
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Template
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Template -> c Template
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Template)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Template)
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Template -> c Template
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Template -> c Template
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Template
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Template
    $ctoConstr :: Template -> Constr
    toConstr :: Template -> Constr
    $cdataTypeOf :: Template -> DataType
    dataTypeOf :: Template -> DataType
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Template)
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Template)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Template)
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Template)
    $cgmapT :: (forall b. Data b => b -> b) -> Template -> Template
    gmapT :: (forall b. Data b => b -> b) -> Template -> Template
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Template -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Template -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Template -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Template -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> Template -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> Template -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Template -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Template -> u
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Template -> m Template
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Template -> m Template
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Template -> m Template
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Template -> m Template
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Template -> m Template
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Template -> m Template
    Data, Typeable, (forall x. Template -> Rep Template x)
    -> (forall x. Rep Template x -> Template) -> Generic Template
    forall x. Rep Template x -> Template
    forall x. Template -> Rep Template x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. Template -> Rep Template x
    from :: forall x. Template -> Rep Template x
    $cto :: forall x. Rep Template x -> Template
    to :: forall x. Rep Template x -> Template
    Generic)

    instance Semigroup Template where
      (Template PName
    pname Map PName [Node]
    x) <> :: Template -> Template -> Template
    <> (Template PName
    _ Map PName [Node]
    y) = PName -> Map PName [Node] -> Template
    Template PName
    pname (Map PName [Node] -> Map PName [Node] -> Map PName [Node]
    forall k a. Ord k => Map k a -> Map k a -> Map k a
    Map.union Map PName [Node]
    x Map PName [Node]
    y)

    -- | Structural element of template.

    data Node
      = TextBlock       Text       -- ^ Plain text contained between tags
      | EscapedVar      Key        -- ^ HTML-escaped variable
      | UnescapedVar    Key        -- ^ Unescaped variable
      | Section         Key [Node] -- ^ Mustache section
      | InvertedSection Key [Node] -- ^ Inverted section
      | Partial         PName (Maybe Word)
        -- ^ Partial with indentation level ('Nothing' means it was inlined)
      deriving (Node -> Node -> Bool
    (Node -> Node -> Bool) -> (Node -> Node -> Bool) -> Eq Node
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Node -> Node -> Bool
    == :: Node -> Node -> Bool
    $c/= :: Node -> Node -> Bool
    /= :: Node -> Node -> Bool
    Eq, Eq Node
    Eq Node =>
    (Node -> Node -> Ordering)
    -> (Node -> Node -> Bool)
    -> (Node -> Node -> Bool)
    -> (Node -> Node -> Bool)
    -> (Node -> Node -> Bool)
    -> (Node -> Node -> Node)
    -> (Node -> Node -> Node)
    -> Ord Node
    Node -> Node -> Bool
    Node -> Node -> Ordering
    Node -> Node -> Node
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: Node -> Node -> Ordering
    compare :: Node -> Node -> Ordering
    $c< :: Node -> Node -> Bool
    < :: Node -> Node -> Bool
    $c<= :: Node -> Node -> Bool
    <= :: Node -> Node -> Bool
    $c> :: Node -> Node -> Bool
    > :: Node -> Node -> Bool
    $c>= :: Node -> Node -> Bool
    >= :: Node -> Node -> Bool
    $cmax :: Node -> Node -> Node
    max :: Node -> Node -> Node
    $cmin :: Node -> Node -> Node
    min :: Node -> Node -> Node
    Ord, Int -> Node -> ShowS
    [Node] -> ShowS
    Node -> [Char]
    (Int -> Node -> ShowS)
    -> (Node -> [Char]) -> ([Node] -> ShowS) -> Show Node
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Node -> ShowS
    showsPrec :: Int -> Node -> ShowS
    $cshow :: Node -> [Char]
    show :: Node -> [Char]
    $cshowList :: [Node] -> ShowS
    showList :: [Node] -> ShowS
    Show, Typeable Node
    Typeable Node =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> Node -> c Node)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c Node)
    -> (Node -> Constr)
    -> (Node -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c Node))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Node))
    -> ((forall b. Data b => b -> b) -> Node -> Node)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Node -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Node -> r)
    -> (forall u. (forall d. Data d => d -> u) -> Node -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> Node -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> Node -> m Node)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Node -> m Node)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Node -> m Node)
    -> Data Node
    Node -> Constr
    Node -> DataType
    (forall b. Data b => b -> b) -> Node -> Node
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> Node -> u
    forall u. (forall d. Data d => d -> u) -> Node -> [u]
    forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Node -> r
    forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Node -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Node -> m Node
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Node -> m Node
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Node
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Node -> c Node
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Node)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Node)
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Node -> c Node
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Node -> c Node
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Node
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Node
    $ctoConstr :: Node -> Constr
    toConstr :: Node -> Constr
    $cdataTypeOf :: Node -> DataType
    dataTypeOf :: Node -> DataType
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Node)
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Node)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Node)
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Node)
    $cgmapT :: (forall b. Data b => b -> b) -> Node -> Node
    gmapT :: (forall b. Data b => b -> b) -> Node -> Node
    $cgmapQl :: forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Node -> r
    gmapQl :: forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Node -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Node -> r
    gmapQr :: forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Node -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> Node -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> Node -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Node -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Node -> u
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Node -> m Node
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Node -> m Node
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Node -> m Node
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Node -> m Node
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Node -> m Node
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Node -> m Node
    Data, Typeable, (forall x. Node -> Rep Node x)
    -> (forall x. Rep Node x -> Node) -> Generic Node
    forall x. Rep Node x -> Node
    forall x. Node -> Rep Node x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. Node -> Rep Node x
    from :: forall x. Node -> Rep Node x
    $cto :: forall x. Rep Node x -> Node
    to :: forall x. Rep Node x -> Node
    Generic)

    -- | Identifier for values to interpolate.
    --
    -- The representation is the following:
    --
    --     * @[]@ — empty list means implicit iterators;
    --     * @[text]@ — single key is a normal identifier;
    --     * @[text1, text2]@ — multiple keys represent dotted names.

    newtype Key = Key { Key -> [Text]
    unKey :: [Text] }
      deriving (Key -> Key -> Bool
    (Key -> Key -> Bool) -> (Key -> Key -> Bool) -> Eq Key
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Key -> Key -> Bool
    == :: Key -> Key -> Bool
    $c/= :: Key -> Key -> Bool
    /= :: Key -> Key -> Bool
    Eq, Eq Key
    Eq Key =>
    (Key -> Key -> Ordering)
    -> (Key -> Key -> Bool)
    -> (Key -> Key -> Bool)
    -> (Key -> Key -> Bool)
    -> (Key -> Key -> Bool)
    -> (Key -> Key -> Key)
    -> (Key -> Key -> Key)
    -> Ord Key
    Key -> Key -> Bool
    Key -> Key -> Ordering
    Key -> Key -> Key
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: Key -> Key -> Ordering
    compare :: Key -> Key -> Ordering
    $c< :: Key -> Key -> Bool
    < :: Key -> Key -> Bool
    $c<= :: Key -> Key -> Bool
    <= :: Key -> Key -> Bool
    $c> :: Key -> Key -> Bool
    > :: Key -> Key -> Bool
    $c>= :: Key -> Key -> Bool
    >= :: Key -> Key -> Bool
    $cmax :: Key -> Key -> Key
    max :: Key -> Key -> Key
    $cmin :: Key -> Key -> Key
    min :: Key -> Key -> Key
    Ord, Int -> Key -> ShowS
    [Key] -> ShowS
    Key -> [Char]
    (Int -> Key -> ShowS)
    -> (Key -> [Char]) -> ([Key] -> ShowS) -> Show Key
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Key -> ShowS
    showsPrec :: Int -> Key -> ShowS
    $cshow :: Key -> [Char]
    show :: Key -> [Char]
    $cshowList :: [Key] -> ShowS
    showList :: [Key] -> ShowS
    Show, NonEmpty Key -> Key
    Key -> Key -> Key
    (Key -> Key -> Key)
    -> (NonEmpty Key -> Key)
    -> (forall b. Integral b => b -> Key -> Key)
    -> Semigroup Key
    forall b. Integral b => b -> Key -> Key
    forall a.
    (a -> a -> a)
    -> (NonEmpty a -> a)
    -> (forall b. Integral b => b -> a -> a)
    -> Semigroup a
    $c<> :: Key -> Key -> Key
    <> :: Key -> Key -> Key
    $csconcat :: NonEmpty Key -> Key
    sconcat :: NonEmpty Key -> Key
    $cstimes :: forall b. Integral b => b -> Key -> Key
    stimes :: forall b. Integral b => b -> Key -> Key
    Semigroup, Semigroup Key
    Key
    Semigroup Key =>
    Key -> (Key -> Key -> Key) -> ([Key] -> Key) -> Monoid Key
    [Key] -> Key
    Key -> Key -> Key
    forall a.
    Semigroup a =>
    a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
    $cmempty :: Key
    mempty :: Key
    $cmappend :: Key -> Key -> Key
    mappend :: Key -> Key -> Key
    $cmconcat :: [Key] -> Key
    mconcat :: [Key] -> Key
    Monoid, Typeable Key
    Typeable Key =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> Key -> c Key)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c Key)
    -> (Key -> Constr)
    -> (Key -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c Key))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Key))
    -> ((forall b. Data b => b -> b) -> Key -> Key)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Key -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Key -> r)
    -> (forall u. (forall d. Data d => d -> u) -> Key -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> Key -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> Key -> m Key)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Key -> m Key)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Key -> m Key)
    -> Data Key
    Key -> Constr
    Key -> DataType
    (forall b. Data b => b -> b) -> Key -> Key
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> Key -> u
    forall u. (forall d. Data d => d -> u) -> Key -> [u]
    forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Key -> r
    forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Key -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Key -> m Key
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Key -> m Key
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Key
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Key -> c Key
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Key)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Key)
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Key -> c Key
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Key -> c Key
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Key
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Key
    $ctoConstr :: Key -> Constr
    toConstr :: Key -> Constr
    $cdataTypeOf :: Key -> DataType
    dataTypeOf :: Key -> DataType
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Key)
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Key)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Key)
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Key)
    $cgmapT :: (forall b. Data b => b -> b) -> Key -> Key
    gmapT :: (forall b. Data b => b -> b) -> Key -> Key
    $cgmapQl :: forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Key -> r
    gmapQl :: forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Key -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Key -> r
    gmapQr :: forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Key -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> Key -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> Key -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Key -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Key -> u
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Key -> m Key
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Key -> m Key
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Key -> m Key
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Key -> m Key
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Key -> m Key
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Key -> m Key
    Data, Typeable, (forall x. Key -> Rep Key x)
    -> (forall x. Rep Key x -> Key) -> Generic Key
    forall x. Rep Key x -> Key
    forall x. Key -> Rep Key x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. Key -> Rep Key x
    from :: forall x. Key -> Rep Key x
    $cto :: forall x. Rep Key x -> Key
    to :: forall x. Rep Key x -> Key
    Generic)

    instance NFData Key

    -- | Pretty-print a key, this is helpful, for example, if you want to
    -- display an error message.

    showKey :: Key -> Text
    showKey :: Key -> Text
    showKey (Key []) = Text
    "<implicit>"
    showKey (Key [Text]
    xs) = Text -> [Text] -> Text
    T.intercalate Text
    "." [Text]
    xs

    -- | Identifier for partials. Note that with the @OverloadedStrings@
    -- extension you can use just string literals to create values of this type.

    newtype PName = PName { PName -> Text
    unPName :: Text }
      deriving (PName -> PName -> Bool
    (PName -> PName -> Bool) -> (PName -> PName -> Bool) -> Eq PName
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: PName -> PName -> Bool
    == :: PName -> PName -> Bool
    $c/= :: PName -> PName -> Bool
    /= :: PName -> PName -> Bool
    Eq, Eq PName
    Eq PName =>
    (PName -> PName -> Ordering)
    -> (PName -> PName -> Bool)
    -> (PName -> PName -> Bool)
    -> (PName -> PName -> Bool)
    -> (PName -> PName -> Bool)
    -> (PName -> PName -> PName)
    -> (PName -> PName -> PName)
    -> Ord PName
    PName -> PName -> Bool
    PName -> PName -> Ordering
    PName -> PName -> PName
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: PName -> PName -> Ordering
    compare :: PName -> PName -> Ordering
    $c< :: PName -> PName -> Bool
    < :: PName -> PName -> Bool
    $c<= :: PName -> PName -> Bool
    <= :: PName -> PName -> Bool
    $c> :: PName -> PName -> Bool
    > :: PName -> PName -> Bool
    $c>= :: PName -> PName -> Bool
    >= :: PName -> PName -> Bool
    $cmax :: PName -> PName -> PName
    max :: PName -> PName -> PName
    $cmin :: PName -> PName -> PName
    min :: PName -> PName -> PName
    Ord, Int -> PName -> ShowS
    [PName] -> ShowS
    PName -> [Char]
    (Int -> PName -> ShowS)
    -> (PName -> [Char]) -> ([PName] -> ShowS) -> Show PName
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> PName -> ShowS
    showsPrec :: Int -> PName -> ShowS
    $cshow :: PName -> [Char]
    show :: PName -> [Char]
    $cshowList :: [PName] -> ShowS
    showList :: [PName] -> ShowS
    Show, Typeable PName
    Typeable PName =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> PName -> c PName)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c PName)
    -> (PName -> Constr)
    -> (PName -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c PName))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PName))
    -> ((forall b. Data b => b -> b) -> PName -> PName)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PName -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PName -> r)
    -> (forall u. (forall d. Data d => d -> u) -> PName -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> PName -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> PName -> m PName)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> PName -> m PName)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> PName -> m PName)
    -> Data PName
    PName -> Constr
    PName -> DataType
    (forall b. Data b => b -> b) -> PName -> PName
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> PName -> u
    forall u. (forall d. Data d => d -> u) -> PName -> [u]
    forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PName -> r
    forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PName -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> PName -> m PName
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PName -> m PName
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c PName
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> PName -> c PName
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c PName)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PName)
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> PName -> c PName
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> PName -> c PName
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c PName
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c PName
    $ctoConstr :: PName -> Constr
    toConstr :: PName -> Constr
    $cdataTypeOf :: PName -> DataType
    dataTypeOf :: PName -> DataType
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c PName)
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c PName)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PName)
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PName)
    $cgmapT :: (forall b. Data b => b -> b) -> PName -> PName
    gmapT :: (forall b. Data b => b -> b) -> PName -> PName
    $cgmapQl :: forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PName -> r
    gmapQl :: forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PName -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PName -> r
    gmapQr :: forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PName -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> PName -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> PName -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PName -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PName -> u
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> PName -> m PName
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> PName -> m PName
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PName -> m PName
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PName -> m PName
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PName -> m PName
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PName -> m PName
    Data, Typeable, (forall x. PName -> Rep PName x)
    -> (forall x. Rep PName x -> PName) -> Generic PName
    forall x. Rep PName x -> PName
    forall x. PName -> Rep PName x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. PName -> Rep PName x
    from :: forall x. PName -> Rep PName x
    $cto :: forall x. Rep PName x -> PName
    to :: forall x. Rep PName x -> PName
    Generic)

    instance IsString PName where
      fromString :: [Char] -> PName
    fromString = Text -> PName
    PName (Text -> PName) -> ([Char] -> Text) -> [Char] -> PName
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [Char] -> Text
    T.pack

    instance NFData PName

    -- | Exception that is thrown when parsing of a template has failed or
    -- referenced values were not provided.

    data MustacheException
      = MustacheParserException ParseError
        -- ^ Template parser has failed. This contains the parse error.
      | MustacheRenderException PName Key
        -- ^ A referenced value was not provided. The exception provides info
        -- about partial in which the issue happened 'PName' and name of the
        -- missing key 'Key'.
      deriving (MustacheException -> MustacheException -> Bool
    (MustacheException -> MustacheException -> Bool)
    -> (MustacheException -> MustacheException -> Bool)
    -> Eq MustacheException
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: MustacheException -> MustacheException -> Bool
    == :: MustacheException -> MustacheException -> Bool
    $c/= :: MustacheException -> MustacheException -> Bool
    /= :: MustacheException -> MustacheException -> Bool
    Eq, Int -> MustacheException -> ShowS
    [MustacheException] -> ShowS
    MustacheException -> [Char]
    (Int -> MustacheException -> ShowS)
    -> (MustacheException -> [Char])
    -> ([MustacheException] -> ShowS)
    -> Show MustacheException
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> MustacheException -> ShowS
    showsPrec :: Int -> MustacheException -> ShowS
    $cshow :: MustacheException -> [Char]
    show :: MustacheException -> [Char]
    $cshowList :: [MustacheException] -> ShowS
    showList :: [MustacheException] -> ShowS
    Show, Typeable, (forall x. MustacheException -> Rep MustacheException x)
    -> (forall x. Rep MustacheException x -> MustacheException)
    -> Generic MustacheException
    forall x. Rep MustacheException x -> MustacheException
    forall x. MustacheException -> Rep MustacheException x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. MustacheException -> Rep MustacheException x
    from :: forall x. MustacheException -> Rep MustacheException x
    $cto :: forall x. Rep MustacheException x -> MustacheException
    to :: forall x. Rep MustacheException x -> MustacheException
    Generic)

    {-# DEPRECATED MustacheRenderException "Not thrown anymore, will be removed in the next major version of microstache" #-}

    -- | @since 1.0.1
    displayMustacheException :: MustacheException -> String
    displayMustacheException :: MustacheException -> [Char]
    displayMustacheException (MustacheParserException ParseError
    e) = ParseError -> [Char]
    forall a. Show a => a -> [Char]
    show ParseError
    e
    displayMustacheException (MustacheRenderException PName
    pname Key
    key) =
        [Char]
    "Referenced value was not provided in partial \"" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Text -> [Char]
    T.unpack (PName -> Text
    unPName PName
    pname) [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++
        [Char]
    "\", key: " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Text -> [Char]
    T.unpack (Key -> Text
    showKey Key
    key)

    instance Exception MustacheException where
        displayException :: MustacheException -> [Char]
    displayException = MustacheException -> [Char]
    displayMustacheException

    -- | @since 1.0.1
    data MustacheWarning
      = MustacheVariableNotFound Key
        -- ^ The template contained a variable for which there was no data counterpart in the current context
      | MustacheDirectlyRenderedValue Key
        -- ^ A complex value such as an Object or Array was directly rendered into the template
      deriving (MustacheWarning -> MustacheWarning -> Bool
    (MustacheWarning -> MustacheWarning -> Bool)
    -> (MustacheWarning -> MustacheWarning -> Bool)
    -> Eq MustacheWarning
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: MustacheWarning -> MustacheWarning -> Bool
    == :: MustacheWarning -> MustacheWarning -> Bool
    $c/= :: MustacheWarning -> MustacheWarning -> Bool
    /= :: MustacheWarning -> MustacheWarning -> Bool
    Eq, Int -> MustacheWarning -> ShowS
    [MustacheWarning] -> ShowS
    MustacheWarning -> [Char]
    (Int -> MustacheWarning -> ShowS)
    -> (MustacheWarning -> [Char])
    -> ([MustacheWarning] -> ShowS)
    -> Show MustacheWarning
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> MustacheWarning -> ShowS
    showsPrec :: Int -> MustacheWarning -> ShowS
    $cshow :: MustacheWarning -> [Char]
    show :: MustacheWarning -> [Char]
    $cshowList :: [MustacheWarning] -> ShowS
    showList :: [MustacheWarning] -> ShowS
    Show, Typeable, (forall x. MustacheWarning -> Rep MustacheWarning x)
    -> (forall x. Rep MustacheWarning x -> MustacheWarning)
    -> Generic MustacheWarning
    forall x. Rep MustacheWarning x -> MustacheWarning
    forall x. MustacheWarning -> Rep MustacheWarning x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. MustacheWarning -> Rep MustacheWarning x
    from :: forall x. MustacheWarning -> Rep MustacheWarning x
    $cto :: forall x. Rep MustacheWarning x -> MustacheWarning
    to :: forall x. Rep MustacheWarning x -> MustacheWarning
    Generic)

    -- | @since 1.0.1
    displayMustacheWarning :: MustacheWarning -> String
    displayMustacheWarning :: MustacheWarning -> [Char]
    displayMustacheWarning (MustacheVariableNotFound Key
    key) =
        [Char]
    "Referenced value was not provided, key: " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Text -> [Char]
    T.unpack (Key -> Text
    showKey Key
    key)
    displayMustacheWarning (MustacheDirectlyRenderedValue Key
    key) =
        [Char]
    "Complex value rendered as such, key: " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Text -> [Char]
    T.unpack (Key -> Text
    showKey Key
    key)

    instance Exception MustacheWarning where
        displayException :: MustacheWarning -> [Char]
    displayException = MustacheWarning -> [Char]
    displayMustacheWarning