Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data TyTree k where
- type TyForest a = [TyTree a]
- data HTree f t where
- type HForest f ts = HList (HTree f) ts
- hmap :: forall {k} (f :: k -> Type) (g :: k -> Type) (t :: TyTree k). (forall a. f a -> g a) -> HTree f t -> HTree g t
- hcmap :: forall {k} (c :: k -> Constraint) (f :: k -> Type) (g :: k -> Type) (t :: TyTree k). AllTree c t => (forall a. c a => f a -> g a) -> HTree f t -> HTree g t
- type family TreeMap f t where ...
- type family ForestMap f t where ...
- htraverse :: forall {k} (h :: Type -> Type) (f :: k -> Type) (g :: k -> Type) (t :: TyTree k). Applicative h => (forall a. f a -> h (g a)) -> HTree f t -> h (HTree g t)
- hctraverse :: forall {k} (c :: k -> Constraint) (h :: Type -> Type) (f :: k -> Type) (g :: k -> Type) (t :: TyTree k). (AllTree c t, Applicative h) => (forall a. c a => f a -> h (g a)) -> HTree f t -> h (HTree g t)
- hFoldMap :: forall {k} (f :: k -> Type) (t :: TyTree k) (b :: Type). Semigroup b => (forall a. f a -> b) -> HTree f t -> b
- hcFoldMap :: forall {k} (c :: k -> Constraint) (f :: k -> Type) (t :: TyTree k) (b :: Type). (AllTree c t, Semigroup b) => (forall a. c a => f a -> b) -> HTree f t -> b
- hFlatten :: forall {k} (f :: k -> Type) (t :: TyTree k). HTree f t -> HList f (FlattenTree t)
- type family FlattenTree t where ...
- type family FlattenForest f where ...
- data Path k t where
- replaceAt :: Path typ t -> f typ -> HTree f t -> HTree f t
- type family AllTree c ts where ...
- class AllTree c ts => AllTreeC c ts
- type family AllForest c t where ...
- allTopHTree :: forall f t. HTree f t -> Dict (AllTree Top t)
- allTopHForest :: forall f t. HForest f t -> Dict (AllForest Top t)
type level tree
a type level rose-tree that is only intended to store something of a certain kind, e.g. Type
Instances
HasField' strat typ t => Decide strat 'False typ ('TyNode typ' (t ': ts')) Source # | |
HasField' strat typ ('TyNode typ' ts) => Decide strat 'True typ ('TyNode typ' (t' ': ts)) Source # | |
HasField' 'BFS typ ('TyNode typ (t ': ts)) Source # | |
HasField' 'BFS typ ('TyNode typ ('[] :: [TyTree Type])) Source # | |
Decide 'BFS (AnyElem typ ts) typ ('TyNode typ' (t ': ts)) => HasField' 'BFS typ ('TyNode typ' (t ': ts)) Source # | |
HasField' 'DFS typ ('TyNode typ (t ': ts)) Source # | |
HasField' 'DFS typ ('TyNode typ ('[] :: [TyTree Type])) Source # | |
Decide 'DFS (Not (Elem typ t)) typ ('TyNode typ' (t ': ts)) => HasField' 'DFS typ ('TyNode typ' (t ': ts)) Source # | |
(forall x. Eq x => Eq (f x), Typeable f) => Eq (ETree (Has (Both (Typeable :: Type -> Constraint) Eq) f)) Source # | |
heterogeneous tree
a heterogeneous rose tree indexed by a TyTree
pattern HLeaf :: forall f a. forall. f a -> HTree f ('TyNode a '[]) | a pattern synonym for the leaf of an HTree |
Instances
(HasField' 'BFS (Labeled l typ) t, Functor f) => HasField (l :: k) (HTree f t) (f typ) Source # | |
Defined in Data.HTree.Labeled | |
(forall x. Eq x => Eq (f x), Typeable f) => Eq (ETree (Has (Both (Typeable :: Type -> Constraint) Eq) f)) Source # | |
(Show (f a2), Show (HForest f t)) => Show (HTree f ('TyNode a2 t)) Source # | |
(Eq (f a2), Eq (HForest f t)) => Eq (HTree f ('TyNode a2 t)) Source # | |
mapping
value level
hmap :: forall {k} (f :: k -> Type) (g :: k -> Type) (t :: TyTree k). (forall a. f a -> g a) -> HTree f t -> HTree g t Source #
map a function over an HTree
hcmap :: forall {k} (c :: k -> Constraint) (f :: k -> Type) (g :: k -> Type) (t :: TyTree k). AllTree c t => (forall a. c a => f a -> g a) -> HTree f t -> HTree g t Source #
map a function with a constraint over an HTree
type level
traversing
htraverse :: forall {k} (h :: Type -> Type) (f :: k -> Type) (g :: k -> Type) (t :: TyTree k). Applicative h => (forall a. f a -> h (g a)) -> HTree f t -> h (HTree g t) Source #
traverse a structure with a function
hctraverse :: forall {k} (c :: k -> Constraint) (h :: Type -> Type) (f :: k -> Type) (g :: k -> Type) (t :: TyTree k). (AllTree c t, Applicative h) => (forall a. c a => f a -> h (g a)) -> HTree f t -> h (HTree g t) Source #
traverse a structure such that a constraint holds; this is the workhorse of mapping and traversing
folding
value level
hFoldMap :: forall {k} (f :: k -> Type) (t :: TyTree k) (b :: Type). Semigroup b => (forall a. f a -> b) -> HTree f t -> b Source #
monoidally folds down a tree to a single value, this is similar to foldMap
hcFoldMap :: forall {k} (c :: k -> Constraint) (f :: k -> Type) (t :: TyTree k) (b :: Type). (AllTree c t, Semigroup b) => (forall a. c a => f a -> b) -> HTree f t -> b Source #
monoidally folds down a tree to a single value using a constraint on
the element in the wrapping functor, this is similar to foldMap
hFlatten :: forall {k} (f :: k -> Type) (t :: TyTree k). HTree f t -> HList f (FlattenTree t) Source #
flatten a heterogeneous tree down to a heterogeneous list
type level
type family FlattenTree t where ... Source #
a type family that flattens a tree down to a list
FlattenTree ('TyNode x xs) = x : FlattenForest xs |
type family FlattenForest f where ... Source #
a type family that flattens a forest down to a list
FlattenForest '[] = '[] | |
FlattenForest (x : xs) = FlattenTree x ++ FlattenForest xs |
paths into the htree and things you can do with those
provides evidence that an element is in the tree by providing a path to the element
Here :: forall a ts. Path a ('TyNode a ts) | |
Deeper :: forall a b t ts. Path a t -> Path a ('TyNode b (t : ts)) | |
Farther :: forall a b t ts. Path a ('TyNode b ts) -> Path a ('TyNode b (t : ts)) |
Instances
replaceAt :: Path typ t -> f typ -> HTree f t -> HTree f t Source #
replace an element at a certain path.
helpful constraints
class AllTree c ts => AllTreeC c ts Source #
constraint synonym for AllTree
Instances
AllTree c ts => AllTreeC (c :: k -> Constraint) (ts :: TyTree k) Source # | |
Defined in Data.HTree.Tree |