Hoogle Search

Within LTS Haskell 24.13 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. class FunctorT t => ApplicativeT (t :: k -> Type -> k' -> Type)

    barbies Data.Functor.Transformer

    A FunctorT with application, providing operations to:

    • embed an "empty" value (tpure)
    • align and combine values (tprod)
    It should satisfy the following laws:
    tmap ((Pair a b) -> Pair (f a) (g b)) (u `tprod' v) = tmap f u `tprod' tmap g v
    
    • Left and right identity
    tmap ((Pair _ b) -> b) (tpure e `tprod' v) = v
    tmap ((Pair a _) -> a) (u `tprod' tpure e) = u
    
    • Associativity
    tmap ((Pair a (Pair b c)) -> Pair (Pair a b) c) (u `tprod' (v `tprod' w)) = (u `tprod' v) `tprod' w
    
    It is to FunctorT in the same way is Applicative relates to Functor. For a presentation of Applicative as a monoidal functor, see Section 7 of Applicative Programming with Effects. There is a default implementation of tprod and tpure based on Generic. Intuitively, it works on types where the value of tpure is uniquely defined. This corresponds rougly to record types (in the presence of sums, there would be several candidates for tpure), where every field is either a Monoid or covered by the argument f.

  2. applicativeClassKey :: Unique

    ghc GHC.Builtin.Names

    No documentation available.

  3. applicativeClassName :: Name

    ghc GHC.Builtin.Names

    No documentation available.

  4. applicativeSpec :: forall (f :: Type -> Type) . (HasCallStack, Eq (f Int), Show (f Int), Applicative f, Typeable f, GenValid (f Int)) => Spec

    genvalidity-hspec Test.Validity

    Standard test spec for properties of Applicative instances for values generated with GenValid instances Example usage:

    applicativeSpecOnArbitrary @[]
    

  5. applicativeSpecOnArbitrary :: forall (f :: Type -> Type) . (HasCallStack, Eq (f Int), Show (f Int), Applicative f, Typeable f, Arbitrary (f Int)) => Spec

    genvalidity-hspec Test.Validity

    Standard test spec for properties of Applicative instances for values generated with Arbitrary instances Example usage:

    applicativeSpecOnArbitrary @[]
    

  6. applicativeSpecOnGens :: forall f a b c . (HasCallStack, Show a, Show (f a), Eq (f a), Show (f b), Eq (f b), Show (f c), Eq (f c), Applicative f, Typeable f, Typeable a, Typeable b, Typeable c) => Gen a -> String -> Gen (f a) -> String -> Gen (f b) -> String -> Gen (a -> b) -> String -> Gen (f (a -> b)) -> String -> Gen (f (b -> c)) -> String -> Spec

    genvalidity-hspec Test.Validity

    Standard test spec for properties of Applicative instances for values generated by given generators (and names for those generator). Unless you are building a specific regression test, you probably want to use the other applicativeSpec functions. Example usage:

    applicativeSpecOnGens
    @Maybe
    @String
    (pure "ABC")
    "ABC"
    (Just <$> pure "ABC")
    "Just an ABC"
    (pure Nothing)
    "purely Nothing"
    ((++) <$> genValid)
    "prepends"
    (pure <$> ((++) <$> genValid))
    "prepends in a Just"
    (pure <$> (flip (++) <$> genValid))
    "appends in a Just"
    

  7. applicativeSpec :: forall (f :: Type -> Type) . (HasCallStack, Eq (f Int), Show (f Int), Applicative f, Typeable f, GenValid (f Int)) => Spec

    genvalidity-hspec Test.Validity.Applicative

    Standard test spec for properties of Applicative instances for values generated with GenValid instances Example usage:

    applicativeSpecOnArbitrary @[]
    

  8. applicativeSpecOnArbitrary :: forall (f :: Type -> Type) . (HasCallStack, Eq (f Int), Show (f Int), Applicative f, Typeable f, Arbitrary (f Int)) => Spec

    genvalidity-hspec Test.Validity.Applicative

    Standard test spec for properties of Applicative instances for values generated with Arbitrary instances Example usage:

    applicativeSpecOnArbitrary @[]
    

  9. applicativeSpecOnGens :: forall f a b c . (HasCallStack, Show a, Show (f a), Eq (f a), Show (f b), Eq (f b), Show (f c), Eq (f c), Applicative f, Typeable f, Typeable a, Typeable b, Typeable c) => Gen a -> String -> Gen (f a) -> String -> Gen (f b) -> String -> Gen (a -> b) -> String -> Gen (f (a -> b)) -> String -> Gen (f (b -> c)) -> String -> Spec

    genvalidity-hspec Test.Validity.Applicative

    Standard test spec for properties of Applicative instances for values generated by given generators (and names for those generator). Unless you are building a specific regression test, you probably want to use the other applicativeSpec functions. Example usage:

    applicativeSpecOnGens
    @Maybe
    @String
    (pure "ABC")
    "ABC"
    (Just <$> pure "ABC")
    "Just an ABC"
    (pure Nothing)
    "purely Nothing"
    ((++) <$> genValid)
    "prepends"
    (pure <$> ((++) <$> genValid))
    "prepends in a Just"
    (pure <$> (flip (++) <$> genValid))
    "appends in a Just"
    

  10. applicativeSpec :: forall (f :: Type -> Type) . (Eq (f Int), Show (f Int), Applicative f, Typeable f, GenValid (f Int)) => Spec

    genvalidity-sydtest Test.Syd.Validity

    Standard test spec for properties of Applicative instances for values generated with GenValid instances Example usage:

    applicativeSpecOnArbitrary @[]
    

Page 10 of many | Previous | Next