transformations-0.2.0.0: Generic representation of tree transformations

Safe HaskellNone
LanguageHaskell98

Generics.Regular.Transformations.Main

Synopsis

Documentation

diff :: forall a. Transform a => a -> a -> Transformation a Source

Find a set of edits to transform the first into the second tree

apply :: Transform a => Transformation a -> a -> Maybe a Source

Apply the edits to the given tree

type Transformation a = [(Path a, Fix (WithRef a))] Source

data WithRef a b Source

Constructors

InR (PF a b) 
Ref (Path a) 

Instances

Functor (PF a) => Functor (WithRef a) 
(ShowPath (PF a), Functor (PF a), Show (PF a)) => Show (Fix (WithRef a)) 

type Path a = [Dir (PF a)] Source

class (Regular a, Children (PF a), Functor (PF a), ZipChildren (PF a), SEq (PF a), ExtractP (PF a), MapP (PF a), GMap (PF a), GOrd (PF a), Eq (PF a)) => Transform a Source

class HasRef a where Source

Associated Types

type RefRep a Source

Methods

toRef :: WithRef a (RefRep a) -> RefRep a Source

fromRef :: RefRep a -> WithRef a (RefRep a) Source