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.

  1. hmap :: forall (f :: k -> Type) (g :: k -> Type) . HFunctor t => (f ~> g) -> t f ~> t g

    functor-combinators Data.Functor.Combinator

    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.

  2. injectContramap :: (Inject t, Contravariant f) => (a -> b) -> f b -> t f a

    functor-combinators Data.Functor.Combinator

    A useful wrapper over the common pattern of contramap-before-inject/inject-and-contramap.

  3. injectMap :: (Inject t, Functor f) => (a -> b) -> f a -> t f b

    functor-combinators Data.Functor.Combinator

    A useful wrapper over the common pattern of fmap-before-inject/inject-and-fmap.

  4. runMapF :: MapF k1 (f :: k -> Type) (a :: k) -> Map k1 (f a)

    functor-combinators Data.Functor.Combinator

    No documentation available.

  5. runNEMapF :: NEMapF k1 (f :: k -> Type) (a :: k) -> NEMap k1 (f a)

    functor-combinators Data.Functor.Combinator

    No documentation available.

  6. gatheredN1Map :: forall f a (as :: [Type]) b . Inplicative f => (NP I (a ': as) -> b) -> (b -> NP I (a ': as)) -> NP f (a ': as) -> f b

    functor-combinators Data.Functor.Invariant.Inplicative

    A version of gatheredNMap for non-empty NP, but only requiring an Inply instance.

  7. gatheredN1MapRec :: forall f a (as :: [Type]) b . Inplicative f => (XRec Identity (a ': as) -> b) -> (b -> XRec Identity (a ': as)) -> Rec f (a ': as) -> f b

    functor-combinators Data.Functor.Invariant.Inplicative

    A version of gatheredNMap using XRec from vinyl instead of NP from sop-core. This can be more convenient because it doesn't require manual unwrapping/wrapping of tuple components.

  8. gatheredNMap :: forall f (as :: [Type]) b . Inplicative f => (NP I as -> b) -> (b -> NP I as) -> NP f as -> f b

    functor-combinators Data.Functor.Invariant.Inplicative

    Given a function to "break out" a data type into a NP (tuple) and one to put it back together from the tuple, gather all of the components together. For example, if you had a data type

    data MyType = MT Int Bool String
    
    and an invariant functor and Inplicative 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:
    concaMapInplicative
    ((MyType x y z) -> I x :* I y :* I z :* Nil)
    ((I x :* I y :* I z :* Nil) -> MyType x y z)
    $ intPrim
    :* boolPrim
    :* stringPrim
    :* Nil
    
    See notes on gatheredNMap for more details and caveats.

  9. gatheredNMapRec :: forall f (as :: [Type]) b . Inplicative f => (XRec Identity as -> b) -> (b -> XRec Identity as) -> Rec f as -> f b

    functor-combinators Data.Functor.Invariant.Inplicative

    A version of gatheredNMap using XRec from vinyl instead of NP from sop-core. This can be more convenient because it doesn't require manual unwrapping/wrapping of tuple components.

  10. swervedN1Map :: forall f a (as :: [Type]) b . Inalt f => (NS I (a ': as) -> b) -> (b -> NS I (a ': as)) -> NP f (a ': as) -> f b

    functor-combinators Data.Functor.Invariant.Internative

    A version of swervedNMap for non-empty NS, but only requiring an Inalt instance.

Page 1034 of many | Previous | Next