ecta-1.0.0.3
Safe HaskellNone
LanguageHaskell2010

Data.ECTA.Paths

Synopsis

Paths

data Path where Source #

Bundled Patterns

pattern EmptyPath :: Path 
pattern ConsPath :: Int -> Path -> Path 

Instances

Instances details
Eq Path Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Methods

(==) :: Path -> Path -> Bool #

(/=) :: Path -> Path -> Bool #

Ord Path Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Methods

compare :: Path -> Path -> Ordering #

(<) :: Path -> Path -> Bool #

(<=) :: Path -> Path -> Bool #

(>) :: Path -> Path -> Bool #

(>=) :: Path -> Path -> Bool #

max :: Path -> Path -> Path #

min :: Path -> Path -> Path #

Show Path Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Methods

showsPrec :: Int -> Path -> ShowS #

show :: Path -> String #

showList :: [Path] -> ShowS #

Generic Path Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Associated Types

type Rep Path :: Type -> Type #

Methods

from :: Path -> Rep Path x #

to :: Rep Path x -> Path #

Hashable Path Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Methods

hashWithSalt :: Int -> Path -> Int #

hash :: Path -> Int #

Pretty Path Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Methods

pretty :: Path -> Text Source #

type Rep Path Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

type Rep Path = D1 ('MetaData "Path" "Data.ECTA.Internal.Paths" "ecta-1.0.0.3-GsgcdoZGkFZA4oJqDsbHRS" 'False) (C1 ('MetaCons "Path" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Int])))

path :: [Int] -> Path Source #

class Pathable t t' | t -> t' where Source #

TODO: Should this be redone as a lens-library traversal? | TODO: I am unhappy about this Emptyable design; makes one question whether this should be a typeclass at all. (Terms/ECTAs differ in that there is always an ECTA Node that represents the value at a path)

Associated Types

type Emptyable t' Source #

Methods

getPath :: Path -> t -> Emptyable t' Source #

getAllAtPath :: Path -> t -> [t'] Source #

modifyAtPath :: (t' -> t') -> Path -> t -> t Source #

Instances

Instances details
Pathable Term Term Source # 
Instance details

Defined in Data.ECTA.Internal.Term

Associated Types

type Emptyable Term Source #

Pathable Node Node Source # 
Instance details

Defined in Data.ECTA.Internal.ECTA.Operations

Associated Types

type Emptyable Node Source #

Pathable [Node] Node Source # 
Instance details

Defined in Data.ECTA.Internal.ECTA.Operations

Associated Types

type Emptyable Node Source #

Methods

getPath :: Path -> [Node] -> Emptyable Node Source #

getAllAtPath :: Path -> [Node] -> [Node] Source #

modifyAtPath :: (Node -> Node) -> Path -> [Node] -> [Node] Source #

data PathTrie Source #

Constructors

TerminalPathTrie 

Instances

Instances details
Eq PathTrie Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Ord PathTrie Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Show PathTrie Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Generic PathTrie Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Associated Types

type Rep PathTrie :: Type -> Type #

Methods

from :: PathTrie -> Rep PathTrie x #

to :: Rep PathTrie x -> PathTrie #

Hashable PathTrie Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Methods

hashWithSalt :: Int -> PathTrie -> Int #

hash :: PathTrie -> Int #

type Rep PathTrie Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

type Rep PathTrie = D1 ('MetaData "PathTrie" "Data.ECTA.Internal.Paths" "ecta-1.0.0.3-GsgcdoZGkFZA4oJqDsbHRS" 'False) ((C1 ('MetaCons "EmptyPathTrie" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TerminalPathTrie" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "PathTrieSingleChild" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PathTrie)) :+: C1 ('MetaCons "PathTrie" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Vector PathTrie)))))

toPathTrie :: [Path] -> PathTrie Source #

Precondition: No path in the input is a subpath of another

data PathEClass Source #

Instances

Instances details
Eq PathEClass Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Ord PathEClass Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Show PathEClass Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Generic PathEClass Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Associated Types

type Rep PathEClass :: Type -> Type #

Hashable PathEClass Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Pretty PathEClass Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

type Rep PathEClass Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

type Rep PathEClass = D1 ('MetaData "PathEClass" "Data.ECTA.Internal.Paths" "ecta-1.0.0.3-GsgcdoZGkFZA4oJqDsbHRS" 'False) (C1 ('MetaCons "PathEClass'" 'PrefixI 'True) (S1 ('MetaSel ('Just "getPathTrie") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PathTrie) :*: S1 ('MetaSel ('Just "getOrigPaths") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Path])))

completedSubsumptionOrdering :: PathEClass -> PathEClass -> Ordering Source #

Extends the subsumption ordering to a total ordering by using the default lexicographic comparison for incomparable elements. | TODO: Optimization opportunity: Redundant work in the hasSubsumingMember calls

Equality constraints over paths

data EqConstraints where Source #

Bundled Patterns

pattern EmptyConstraints :: EqConstraints 

Instances

Instances details
Eq EqConstraints Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Ord EqConstraints Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Show EqConstraints Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Generic EqConstraints Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Associated Types

type Rep EqConstraints :: Type -> Type #

Hashable EqConstraints Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

Pretty EqConstraints Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

type Rep EqConstraints Source # 
Instance details

Defined in Data.ECTA.Internal.Paths

type Rep EqConstraints = D1 ('MetaData "EqConstraints" "Data.ECTA.Internal.Paths" "ecta-1.0.0.3-GsgcdoZGkFZA4oJqDsbHRS" 'False) (C1 ('MetaCons "EqConstraints" 'PrefixI 'True) (S1 ('MetaSel ('Just "getEclasses") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PathEClass])) :+: C1 ('MetaCons "EqContradiction" 'PrefixI 'False) (U1 :: Type -> Type))