-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | vocabulary representation for predicting program properties -- -- Please see the README on GitHub at -- https://github.com/ijaketak/ast-path#readme @package ast-path @version 0.1.2 -- | AST-path is a representation for predicting program properties. module Data.ASTPath type HalfPath = [String] -- | (top node, [..., start node], [..., end node]) type ASTPath = (String, HalfPath, HalfPath) -- | Generate AST-paths from tree. astPath :: AST a => a -> [ASTPath] -- | Typeclass for tree or terminal node. class AST a -- | Generate paths and half paths for recursion. astPathWithHalf :: AST a => a -> String -> ([ASTPath], [HalfPath]) -- | Generate paths and half paths for recursion. astPathWithHalf :: (AST a, Generic a, AST' (Rep a)) => a -> String -> ([ASTPath], [HalfPath]) -- | Default implementation for tree type. treePath :: forall a. (Generic a, AST' (Rep a)) => a -> String -> ([ASTPath], [HalfPath]) -- | Typical implementation for terminal node type. terminalPath :: (a -> String) -> a -> String -> ([ASTPath], [HalfPath]) -- | Class of generic representation types that can be parsed into paths. class AST' f -- | Default implementation for generic instances of AST. astPathWithHalf' :: AST' f => f a -> String -> ([ASTPath], [HalfPath]) instance Data.ASTPath.AST a => Data.ASTPath.AST' (GHC.Generics.K1 i a) instance Data.ASTPath.AST a => Data.ASTPath.AST [a] instance Data.ASTPath.AST' GHC.Generics.V1 instance Data.ASTPath.AST' GHC.Generics.U1 instance (Data.ASTPath.AST' f, Data.ASTPath.AST' g) => Data.ASTPath.AST' (f GHC.Generics.:+: g) instance (Data.ASTPath.AST' f, Data.ASTPath.AST' g) => Data.ASTPath.AST' (f GHC.Generics.:*: g) instance (Data.ASTPath.AST' f, GHC.Generics.Datatype d) => Data.ASTPath.AST' (GHC.Generics.D1 d f) instance (Data.ASTPath.AST' f, GHC.Generics.Constructor c) => Data.ASTPath.AST' (GHC.Generics.C1 c f) instance (Data.ASTPath.AST' f, GHC.Generics.Selector s) => Data.ASTPath.AST' (GHC.Generics.S1 s f)