Safe Haskell | None |
---|---|
Language | Haskell2010 |
A module describing applicative functors
- module Algebra.Functor
- class Functor f => SemiApplicative f where
- class (Unit f, SemiApplicative f) => Applicative f
- newtype Zip f a = Zip {
- deZip :: f a
- newtype Backwards f a = Backwards {
- forwards :: f a
- c'zip :: Constraint (f a) -> Constraint (Zip f a)
- c'backwards :: Constraint (f a) -> Constraint (Backwards f a)
- (*>) :: SemiApplicative f => f b -> f a -> f a
- (<*) :: SemiApplicative f => f a -> f b -> f a
- (<**>) :: SemiApplicative f => f (a -> b) -> f a -> f b
- ap :: Applicative f => f (a -> b) -> f a -> f b
- between :: SemiApplicative f => f b -> f c -> f a -> f a
- liftA :: Functor f => (a -> b) -> f a -> f b
- liftA2 :: SemiApplicative f => (a -> b -> c) -> f a -> f b -> f c
- liftA3 :: SemiApplicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
- liftA4 :: SemiApplicative f => (a -> b -> c -> d -> e) -> f a -> f b -> f c -> f d -> f e
- forever :: SemiApplicative f => f a -> f b
- zap :: SemiApplicative (Zip f) => f (a -> b) -> f a -> f b
- zap3 :: SemiApplicative (Zip f) => f (a -> b -> c) -> f a -> f b -> f c
- zipWith :: (Functor f, SemiApplicative (Zip f)) => (a -> b -> c) -> f a -> f b -> f c
- zipWith3 :: (Functor f, SemiApplicative (Zip f)) => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
- plusA :: (SemiApplicative f, Semigroup a) => f a -> f a -> f a
- zeroA :: (Unit f, Monoid a) => f a
Documentation
module Algebra.Functor
class Functor f => SemiApplicative f where Source #
(<*>) :: f (a -> b) -> f a -> f b infixl 1 Source #
(<*>) :: Monad f => f (a -> b) -> f a -> f b infixl 1 Source #
class (Unit f, SemiApplicative f) => Applicative f Source #
A wrapper type for lists with zipping Applicative instances, such that
Zip [f1,...,fn]
<*>
Zip [x1,...,xn] == Zip [f1 x1,...,fn xn]
Unit (Zip []) Source # | |
Unit (Zip Maybe) Source # | |
Unit (Zip Tree) Source # | |
Unit (Zip (Free f)) Source # | |
Foldable f => Foldable (Zip f) Source # | |
Applicative (Zip []) Source # | |
Applicative (Zip Maybe) Source # | |
Applicative (Zip Tree) Source # | |
(Functor f, Applicative (Zip f)) => Applicative (Zip (Free f)) Source # | |
SemiApplicative (Zip []) Source # | |
SemiApplicative (Zip Maybe) Source # | |
SemiApplicative (Zip Tree) Source # | |
(Functor f, SemiApplicative (Zip f)) => SemiApplicative (Zip (Free f)) Source # | |
Functor f => Functor (Zip f) Source # | |
(Applicative (Zip f), Monoid a) => Monoid (Zip f a) Source # | |
(SemiApplicative (Zip f), Semigroup a) => Semigroup (Zip f a) Source # | |
newtype Backwards f a Source #
A wrapper for applicative functors with actions executed in the reverse order
Unit f => Unit (Backwards f) Source # | |
Applicative f => Applicative (Backwards f) Source # | |
SemiApplicative f => SemiApplicative (Backwards f) Source # | |
Functor f => Functor (Backwards f) Source # | |
Ring (f a) => Ring (Backwards f a) Source # | |
Semiring (f a) => Semiring (Backwards f a) Source # | |
Monoid (f a) => Monoid (Backwards f a) Source # | |
Semigroup (f a) => Semigroup (Backwards f a) Source # | |
c'zip :: Constraint (f a) -> Constraint (Zip f a) Source #
c'backwards :: Constraint (f a) -> Constraint (Backwards f a) Source #
(*>) :: SemiApplicative f => f b -> f a -> f a infixl 3 Source #
(<*) :: SemiApplicative f => f a -> f b -> f a infixl 3 Source #
(<**>) :: SemiApplicative f => f (a -> b) -> f a -> f b infixl 1 Source #
ap :: Applicative f => f (a -> b) -> f a -> f b Source #
between :: SemiApplicative f => f b -> f c -> f a -> f a Source #
liftA2 :: SemiApplicative f => (a -> b -> c) -> f a -> f b -> f c Source #
liftA3 :: SemiApplicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d Source #
liftA4 :: SemiApplicative f => (a -> b -> c -> d -> e) -> f a -> f b -> f c -> f d -> f e Source #
forever :: SemiApplicative f => f a -> f b Source #
zap :: SemiApplicative (Zip f) => f (a -> b) -> f a -> f b Source #
zap3 :: SemiApplicative (Zip f) => f (a -> b -> c) -> f a -> f b -> f c Source #
zipWith3 :: (Functor f, SemiApplicative (Zip f)) => (a -> b -> c -> d) -> f a -> f b -> f c -> f d Source #
plusA :: (SemiApplicative f, Semigroup a) => f a -> f a -> f a Source #