smartcheck-0.2.4: A smarter QuickCheck.

Safe HaskellSafe
LanguageHaskell2010

Test.SmartCheck.DataToTree

Synopsis

Documentation

getAtIdx Source #

Arguments

:: SubTypes a 
=> a

Value

-> Idx

Index of hole

-> Maybe Int

Maximum depth we want to extract

-> Maybe SubT 

Returns the value at index idx. Returns nothing if the index is out of bounds.

replaceAtIdx Source #

Arguments

:: (SubTypes a, Typeable b) 
=> a

Parent value

-> Idx

Index of hole to replace

-> b

Value to replace with

-> Maybe a 

Replace a value at index idx generically in a Tree/Forest generically.

getIdxForest :: Forest a -> Idx -> Maybe (Tree a) Source #

Get the tree at idx in a forest. Nothing if the index is out-of-bounds.

breadthLevels :: Forest a -> [[a]] Source #

Return the list of values at each level in a Forest Not like levels in Data.Tree (but what I imagined it should have done!).

mkSubstForest :: SubTypes a => a -> b -> Forest b Source #

Make a substitution Forest (all proper children). Initially we don't replace anything.

depth :: Forest a -> Int Source #

Get the depth of a Forest. 0-based (an empty Forest has depth 0).