    {-# OPTIONS_GHC -fno-warn-orphans #-}

    module Data.Validity.Tree where

    import Data.Tree
    import Data.Validity

    -- | A 'Tree' of things is valid if all the things in the 'Tree' are valid.
    instance (Validity a) => Validity (Tree a) where
      validate :: Tree a -> Validation
    validate (Node a
    rl [Tree a]
    sf) =
        [Validation] -> Validation
    forall a. Monoid a => [a] -> a
    mconcat [a -> String -> Validation
    forall a. Validity a => a -> String -> Validation
    annotate a
    rl String
    "rootLabel", [Tree a] -> String -> Validation
    forall a. Validity a => a -> String -> Validation
    annotate [Tree a]
    sf String
    "subForest"]