Hoogle Search
Within LTS Haskell 24.45 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
functor-combinators Data.Functor.Invariant.Internative Given a function to "discern out" a data type into possible NS (multi-way Either) branches and one to re-assemble each brann, swerve all of the components together. For example, if you had a data type
data MyType = MTI Int | MTB Bool | MTS String
and an invariant functor and Inplus instance Prim (representing, say, a bidirectional parser, where Prim Int is a bidirectional parser for an Int), then you could assemble a bidirectional parser for a MyType@ using:swervedNMap (case MTI x -> Z (I x); MTB y -> S (Z (I y)); MTS z -> S (S (Z (I z)))) (case Z (I x) -> MTI x; S (Z (I y)) -> MTB y; S (S (Z (I z))) -> MTS z) $ $ intPrim :* boolPrim :* stringPrim :* Nil
Some notes on usefulness depending on how many components you have:- If you have 0 components, use reject directly.
- If you have 1 component, you don't need anything.
- If you have 2 components, use swerve directly.
- If you have 3 or more components, these combinators may be useful; otherwise you'd need to manually peel off eithers one-by-one.
-
functor-combinators Data.HBifunctor Swap out both transformed functors at the same time.
hmap :: forall (f :: k -> Type) (g :: k -> Type) . HFunctor t => (f ~> g) -> t f ~> t gfunctor-combinators Data.HFunctor If we can turn an f into a g, then we can turn a t f into a t g. It must be the case that
hmap id == id
Essentially, t f adds some "extra structure" to f. hmap must swap out the functor, without affecting the added structure. For example, ListF f a is essentially a list of f as. If we hmap to swap out the f as for g as, then we must ensure that the "added structure" (here, the number of items in the list, and the ordering of those items) remains the same. So, hmap must preserve the number of items in the list, and must maintain the ordering. The law hmap id == id is a way of formalizing this property.injectContramap :: (Inject t, Contravariant f) => (a -> b) -> f b -> t f afunctor-combinators Data.HFunctor A useful wrapper over the common pattern of contramap-before-inject/inject-and-contramap.
injectMap :: (Inject t, Functor f) => (a -> b) -> f a -> t f bfunctor-combinators Data.HFunctor A useful wrapper over the common pattern of fmap-before-inject/inject-and-fmap.
-
functor-products Data.Type.Functor.Product A foldMap over all items in a collection.
-
functor-products Data.Type.Functor.Product foldMapSing but with access to the index.
module Data.GenValidity.
HashMap No documentation available.
bitmap :: GenClosure b -> ![Word]ghc-heap GHC.Exts.Heap An StgLargeBitmap describing the pointerhood of its args/free vars
bitmap :: GenClosure b -> ![Word]ghc-heap GHC.Exts.Heap.Closures An StgLargeBitmap describing the pointerhood of its args/free vars