Functor is:module

A type f is a Functor if it provides a function fmap which, given any types a and b, lets you apply any function of type (a -> b) to turn an f a into an f b, preserving the structure of f.
The deriving code for the Functor, Foldable, and Traversable classes
Convenient functions to work with Functor.
Functor properties You will need TypeApplications to use these.
Functor properties You will need TypeApplications to use these.
Utilities for functors.
A type f is a Functor if it provides a function fmap which, given any types a and b, lets you apply any function of type (a -> b) to turn an f a into an f b, preserving the structure of f.

Examples

>>> fmap show (Just 1)  --  (a   -> b)      -> f a       -> f b
Just "1"                --  (Int -> String) -> Maybe Int -> Maybe String
>>> fmap show Nothing   --  (a   -> b)      -> f a       -> f b
Nothing                 --  (Int -> String) -> Maybe Int -> Maybe String
>>> fmap show [1,2,3]   --  (a   -> b)      -> f a       -> f b
["1","2","3"]           --  (Int -> String) -> [Int]     -> [String]
>>> fmap show []        --  (a   -> b)      -> f a       -> f b
[]                      --  (Int -> String) -> [Int]     -> [String]
The fmap function is also available as the infix operator <$>:
>>> fmap show (Just 1) --  (Int -> String) -> Maybe Int -> Maybe String
Just "1"
>>> show <$> (Just 1)  --  (Int -> String) -> Maybe Int -> Maybe String
Just "1"
Provides a Functor instance for Dimensional. Note that this instance is dubious, because it allows you to break the dimensional abstraction. See dmap for more information. Note that, while this instance overlaps with that given for Dimensionless, it is confluent with that instance. Note that this is an orphan instance.
Some higher-kinded Functor types that make do until we get FunctorOf eg https://eevie.ro/posts/2019-05-12-functor-of.html
This should probably be a separate library, but it provides a number of functor type classes between various categories.
This provides a subset of the functionality as the invariant package's Data.Functor.Invariant module, but based on Data.Invertible, without all the instances, and with an interface matching Data.Functor. This module is intended to be imported qualified, e.g.,:
import qualified Control.Invertible.Functor as Inv
Bidirectional version of Data.Functor.
Poly-kinded Functor type class. KFunctor generalizes functors, bifunctors, profunctors, ... by declaring a list of Variances for a type constructor.
Eliminator functions for data types in the Data.Functor.* module namespace. All of these are re-exported from Data.Eliminator with the exceptions of Sum and Product, as these clash with eliminators of the same names in Data.Eliminator.Semigroup and Data.Eliminator.Monoid.
Consider the category of Haskell quivers with
  • objects are types of higher kind
  • p :: k -> k -> Type
  • morphisms are terms of RankNType,
  • forall x y. p x y -> q x y
  • identity is id
  • composition is .
There is a natural hierarchy of typeclasses for endofunctors of the category of Haskell quivers, analagous to that for Haskell types.