smartcheck-0.2.1: A smarter QuickCheck.

Safe HaskellNone

Test.SmartCheck.DataToTree

Synopsis

Documentation

getAtIdxSource

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.

replaceAtIdxSource

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 bSource

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

depth :: Forest a -> IntSource

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