Data.Functor.Compat

base-compat-0.13.1: A compatibility layer for base

Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.Functor.Compat

Synopsis

- class Functor (f :: Type -> Type) where
  - fmap :: (a -> b) -> f a -> f b
  - (<$) :: a -> f b -> f a
- ($>) :: Functor f => f a -> b -> f b
- void :: Functor f => f a -> f ()
- (<&>) :: Functor f => f a -> (a -> b) -> f b
- unzip :: Functor f => f (a, b) -> (f a, f b)

# Documentation

class Functor (f :: Type -> Type) where #

Minimal complete definition

fmap

Methods

fmap :: (a -> b) -> f a -> f b #

(<$) :: a -> f b -> f a #

#### Instances

Instances details

Functor ZipList |
Instance details Defined in Control.Applicative Methods fmap :: (a -> b) -> ZipList a -> ZipList b # (<$) :: a -> ZipList b -> ZipList a #
Functor Handler |
Instance details Defined in Control.Exception Methods fmap :: (a -> b) -> Handler a -> Handler b # (<$) :: a -> Handler b -> Handler a #
Functor Complex |
Instance details Defined in Data.Complex Methods fmap :: (a -> b) -> Complex a -> Complex b # (<$) :: a -> Complex b -> Complex a #
Functor Identity |
Instance details Defined in Data.Functor.Identity Methods fmap :: (a -> b) -> Identity a -> Identity b # (<$) :: a -> Identity b -> Identity a #
Functor First |
Instance details Defined in Data.Monoid Methods fmap :: (a -> b) -> First a -> First b # (<$) :: a -> First b -> First a #
Functor Last |
Instance details Defined in Data.Monoid Methods fmap :: (a -> b) -> Last a -> Last b # (<$) :: a -> Last b -> Last a #
Functor First |
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> First a -> First b # (<$) :: a -> First b -> First a #
Functor Last |
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Last a -> Last b # (<$) :: a -> Last b -> Last a #
Functor Max |
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Max a -> Max b # (<$) :: a -> Max b -> Max a #
Functor Min |
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Min a -> Min b # (<$) :: a -> Min b -> Min a #
Functor Dual |
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Dual a -> Dual b # (<$) :: a -> Dual b -> Dual a #
Functor Product |
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Product a -> Product b # (<$) :: a -> Product b -> Product a #
Functor Sum |
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Sum a -> Sum b # (<$) :: a -> Sum b -> Sum a #
Functor NonEmpty |
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> NonEmpty a -> NonEmpty b # (<$) :: a -> NonEmpty b -> NonEmpty a #
Functor STM |
Instance details Defined in GHC.Conc.Sync Methods fmap :: (a -> b) -> STM a -> STM b # (<$) :: a -> STM b -> STM a #
Functor P |
Instance details Defined in Text.ParserCombinators.ReadP Methods fmap :: (a -> b) -> P a -> P b # (<$) :: a -> P b -> P a #
Functor ReadP |
Instance details Defined in Text.ParserCombinators.ReadP Methods fmap :: (a -> b) -> ReadP a -> ReadP b # (<$) :: a -> ReadP b -> ReadP a #
Functor ReadPrec |
Instance details Defined in Text.ParserCombinators.ReadPrec Methods fmap :: (a -> b) -> ReadPrec a -> ReadPrec b # (<$) :: a -> ReadPrec b -> ReadPrec a #
Functor IO |
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> IO a -> IO b # (<$) :: a -> IO b -> IO a #
Functor Maybe |
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> Maybe a -> Maybe b # (<$) :: a -> Maybe b -> Maybe a #
Functor Solo |
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> Solo a -> Solo b # (<$) :: a -> Solo b -> Solo a #
Functor List |
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> [a] -> [b] # (<$) :: a -> [b] -> [a] #
Monad m => Functor (WrappedMonad m) |
Instance details Defined in Control.Applicative Methods fmap :: (a -> b) -> WrappedMonad m a -> WrappedMonad m b # (<$) :: a -> WrappedMonad m b -> WrappedMonad m a #
Functor (ST s) |
Instance details Defined in Control.Monad.ST.Lazy.Imp Methods fmap :: (a -> b) -> ST s a -> ST s b # (<$) :: a -> ST s b -> ST s a #
Functor (Either a) |
Instance details Defined in Data.Either Methods fmap :: (a0 -> b) -> Either a a0 -> Either a b # (<$) :: a0 -> Either a b -> Either a a0 #
Functor (Proxy :: Type -> Type) |
Instance details Defined in Data.Proxy Methods fmap :: (a -> b) -> Proxy a -> Proxy b # (<$) :: a -> Proxy b -> Proxy a #
Functor (Arg a) |
Instance details Defined in Data.Semigroup Methods fmap :: (a0 -> b) -> Arg a a0 -> Arg a b # (<$) :: a0 -> Arg a b -> Arg a a0 #
Functor (ST s) |
Instance details Defined in GHC.ST Methods fmap :: (a -> b) -> ST s a -> ST s b # (<$) :: a -> ST s b -> ST s a #
Functor ((,) a) |
Instance details Defined in GHC.Base Methods fmap :: (a0 -> b) -> (a, a0) -> (a, b) # (<$) :: a0 -> (a, b) -> (a, a0) #
Arrow a => Functor (WrappedArrow a b) |
Instance details Defined in Control.Applicative Methods fmap :: (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # (<$) :: a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 #
Functor (Const m :: Type -> Type) |
Instance details Defined in Data.Functor.Const Methods fmap :: (a -> b) -> Const m a -> Const m b # (<$) :: a -> Const m b -> Const m a #
Functor f => Functor (Ap f) |
Instance details Defined in Data.Monoid Methods fmap :: (a -> b) -> Ap f a -> Ap f b # (<$) :: a -> Ap f b -> Ap f a #
Functor f => Functor (Alt f) |
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Alt f a -> Alt f b # (<$) :: a -> Alt f b -> Alt f a #
Functor ((,,) a b) |
Instance details Defined in GHC.Base Methods fmap :: (a0 -> b0) -> (a, b, a0) -> (a, b, b0) # (<$) :: a0 -> (a, b, b0) -> (a, b, a0) #
(Functor f, Functor g) => Functor (Product f g) |
Instance details Defined in Data.Functor.Product Methods fmap :: (a -> b) -> Product f g a -> Product f g b # (<$) :: a -> Product f g b -> Product f g a #
(Functor f, Functor g) => Functor (Sum f g) |
Instance details Defined in Data.Functor.Sum Methods fmap :: (a -> b) -> Sum f g a -> Sum f g b # (<$) :: a -> Sum f g b -> Sum f g a #
Functor ((,,,) a b c) |
Instance details Defined in GHC.Base Methods fmap :: (a0 -> b0) -> (a, b, c, a0) -> (a, b, c, b0) # (<$) :: a0 -> (a, b, c, b0) -> (a, b, c, a0) #
Functor ((->) r) |
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> (r -> a) -> r -> b # (<$) :: a -> (r -> b) -> r -> a #
(Functor f, Functor g) => Functor (Compose f g) |
Instance details Defined in Data.Functor.Compose Methods fmap :: (a -> b) -> Compose f g a -> Compose f g b # (<$) :: a -> Compose f g b -> Compose f g a #
Functor ((,,,,) a b c d) |
Instance details Defined in GHC.Base Methods fmap :: (a0 -> b0) -> (a, b, c, d, a0) -> (a, b, c, d, b0) # (<$) :: a0 -> (a, b, c, d, b0) -> (a, b, c, d, a0) #
Functor ((,,,,,) a b c d e) |
Instance details Defined in GHC.Base Methods fmap :: (a0 -> b0) -> (a, b, c, d, e, a0) -> (a, b, c, d, e, b0) # (<$) :: a0 -> (a, b, c, d, e, b0) -> (a, b, c, d, e, a0) #
Functor ((,,,,,,) a b c d e f) |
Instance details Defined in GHC.Base Methods fmap :: (a0 -> b0) -> (a, b, c, d, e, f, a0) -> (a, b, c, d, e, f, b0) # (<$) :: a0 -> (a, b, c, d, e, f, b0) -> (a, b, c, d, e, f, a0) #

($>) :: Functor f => f a -> b -> f b #

void :: Functor f => f a -> f () #

(<&>) :: Functor f => f a -> (a -> b) -> f b #

unzip :: Functor f => f (a, b) -> (f a, f b) #

Generalization of `Data.List.` `unzip`.

Since: 4.19.0.0