Functor (functional Programming)
   HOME
*





Functor (functional Programming)
In functional programming, a functor is a design pattern inspired by the definition from category theory that allows one to apply a function to values inside a generic type without changing the structure of the generic type. In Haskell this idea can be captured in a type class: class Functor f where fmap :: (a -> b) -> f a -> f b with conditions called ''functor laws'' (where . stands for function composition), fmap id = id fmap (g . h) = (fmap g) . (fmap h) In Scala a trait can be used: trait Functor Applicative_Functor,_[__ Functors_form_a_base_for_more_complex_abstractions_like_Applicative_functor">Applicative_Functor,_Monad_(functional_programming)">Monad,_and_Monad_(functional_programming)#Comonads.html" "title="Monad_(functional_programming).html" "title="Applicative_functor.html" ;"title="[_.html" ;"title="[_">[_ Functors form a base for more complex abstractions like Applicative functor">Applicative Functor, Monad (functional programming)">Monad, and ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Tree As A Functor
In botany, a tree is a perennial plant with an elongated stem, or trunk, usually supporting branches and leaves. In some usages, the definition of a tree may be narrower, including only woody plants with secondary growth, plants that are usable as lumber or plants above a specified height. In wider definitions, the taller palms, tree ferns, bananas, and bamboos are also trees. Trees are not a taxonomic group but include a variety of plant species that have independently evolved a trunk and branches as a way to tower above other plants to compete for sunlight. The majority of tree species are angiosperms or hardwoods; of the rest, many are gymnosperms or softwoods. Trees tend to be long-lived, some reaching several thousand years old. Trees have been in existence for 370 million years. It is estimated that there are some three trillion mature trees in the world. A tree typically has many secondary branches supported clear of the ground by the trunk. This trunk typically co ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  



MORE