HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Modulehedgehog-1.7Haskell2010

Hedgehog.Internal.Tree

Synopsis
  • Packagehedgehog-1.7
  • Exports27
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceTree.hs
newtypenewtype TreeT (m :: Type -> Type) a

An effectful tree, each node in the tree can have an effect before it is produced.

Constructors

Instances29Foldable, Traversable, MonadTrans, MMonad, MonadTransDistributive, MFunctor, …
patternpattern Node :: a -> [Tree a] -> Node a

Pattern to ease construction / deconstruction of pure nodes.

datadata NodeT (m :: Type -> Type) a

A node in an effectful tree, as well as its unevaluated children.

Constructors

Instances9Foldable, Traversable, MFunctor, Monad, Functor, Applicative, …
valueunfold :: Monad m => (a -> [a]) -> a -> TreeT m a

Create a tree from a value and an unfolding function.

valueprune :: Monad m => Int -> TreeT m a -> TreeT m a

Throw away all but the top n levels of a tree's children.

prune 0 will throw away all of a tree's children.

valuefilter :: (a -> Bool) -> Tree a -> Maybe (Tree a)

Returns a tree containing only elements that match the predicate.

If the root of the tree does not match the predicate then Nothing is returned.