Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Path where
- unPath :: Path -> [Int]
- path :: [Int] -> Path
- class Pathable t t' | t -> t' where
- type Emptyable t'
- getPath :: Path -> t -> Emptyable t'
- getAllAtPath :: Path -> t -> [t']
- modifyAtPath :: (t' -> t') -> Path -> t -> t
- pathHeadUnsafe :: Path -> Int
- pathTailUnsafe :: Path -> Path
- isSubpath :: Path -> Path -> Bool
- data PathTrie = TerminalPathTrie
- isEmptyPathTrie :: PathTrie -> Bool
- isTerminalPathTrie :: PathTrie -> Bool
- getMaxNonemptyIndex :: PathTrie -> Maybe Int
- toPathTrie :: [Path] -> PathTrie
- fromPathTrie :: PathTrie -> [Path]
- pathTrieDescend :: PathTrie -> Int -> PathTrie
- data PathEClass
- unPathEClass :: PathEClass -> [Path]
- hasSubsumingMember :: PathEClass -> PathEClass -> Bool
- completedSubsumptionOrdering :: PathEClass -> PathEClass -> Ordering
- data EqConstraints where
- pattern EmptyConstraints :: EqConstraints
- unsafeGetEclasses :: EqConstraints -> [PathEClass]
- mkEqConstraints :: [[Path]] -> EqConstraints
- combineEqConstraints :: EqConstraints -> EqConstraints -> EqConstraints
- eqConstraintsDescend :: EqConstraints -> Int -> EqConstraints
- constraintsAreContradictory :: EqConstraints -> Bool
- constraintsImply :: EqConstraints -> EqConstraints -> Bool
- subsumptionOrderedEclasses :: EqConstraints -> Maybe [PathEClass]
- unsafeSubsumptionOrderedEclasses :: EqConstraints -> [PathEClass]
Paths
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)
getPath :: Path -> t -> Emptyable t' Source #
getAllAtPath :: Path -> t -> [t'] Source #
modifyAtPath :: (t' -> t') -> Path -> t -> t Source #
pathHeadUnsafe :: Path -> Int Source #
pathTailUnsafe :: Path -> Path Source #
Instances
Eq PathTrie Source # | |
Ord PathTrie Source # | |
Defined in Data.ECTA.Internal.Paths | |
Show PathTrie Source # | |
Generic PathTrie Source # | |
Hashable PathTrie Source # | |
Defined in Data.ECTA.Internal.Paths | |
type Rep PathTrie Source # | |
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))))) |
isEmptyPathTrie :: PathTrie -> Bool Source #
isTerminalPathTrie :: PathTrie -> Bool Source #
toPathTrie :: [Path] -> PathTrie Source #
Precondition: No path in the input is a subpath of another
fromPathTrie :: PathTrie -> [Path] Source #
data PathEClass Source #
Instances
unPathEClass :: PathEClass -> [Path] Source #
hasSubsumingMember :: PathEClass -> PathEClass -> Bool Source #
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 #
pattern EmptyConstraints :: EqConstraints |
Instances
unsafeGetEclasses :: EqConstraints -> [PathEClass] Source #
mkEqConstraints :: [[Path]] -> EqConstraints Source #
eqConstraintsDescend :: EqConstraints -> Int -> EqConstraints Source #
constraintsImply :: EqConstraints -> EqConstraints -> Bool Source #