Applicative Functor
   HOME
*





Applicative Functor
In functional programming, an applicative functor, or an applicative for short, is an intermediate structure between functors and monads. Applicative functors allow for functorial computations to be sequenced (unlike plain functors), but don't allow using results from prior computations in the definition of subsequent ones (unlike monads). Applicative functors are the programming equivalent of lax monoidal functors with tensorial strength in category theory. Applicative functors were introduced in 2008 by Conor McBride and Ross Paterson in their paper ''Applicative programming with effects''. Applicative functors first appeared as a library feature in Haskell, but have since spread to other languages as well, including Idris, Agda, OCaml, Scala and F#. Glasgow Haskell, Idris, and F# offer language features designed to ease programming with applicative functors. In Haskell, applicative functors are implemented in the Applicative type class. Definition In Haskell, an applic ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Monad (functional Programming)
In functional programming, a monad is a software design pattern with a structure that combines program fragments (Function (computer programming), functions) and wraps their return values in a Type system, type with additional computation. In addition to defining a wrapping monadic type, monads define two Operator (computer programming), operators: one to wrap a value in the monad type, and another to compose together functions that output values of the monad type (these are known as monadic functions). General-purpose languages use monads to reduce boilerplate code needed for common operations (such as dealing with undefined values or fallible functions, or encapsulating bookkeeping code). Functional languages use monads to turn complicated sequences of functions into succinct pipelines that abstract away control flow, and side-effect (computer science), side-effects. Both the concept of a monad and the term originally come from category theory, where a monad is defined as a Func ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Functional Programming
In computer science, functional programming is a programming paradigm where programs are constructed by Function application, applying and Function composition (computer science), composing Function (computer science), functions. It is a declarative programming paradigm in which function definitions are Tree (data structure), trees of Expression (computer science), expressions that map Value (computer science), values to other values, rather than a sequence of Imperative programming, imperative Statement (computer science), statements which update the State (computer science), running state of the program. In functional programming, functions are treated as first-class citizens, meaning that they can be bound to names (including local Identifier (computer languages), identifiers), passed as Parameter (computer programming), arguments, and Return value, returned from other functions, just as any other data type can. This allows programs to be written in a Declarative programming, ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


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]  


Monoidal Functor
In category theory, monoidal functors are functors between monoidal categories which preserve the monoidal structure. More specifically, a monoidal functor between two monoidal categories consists of a functor between the categories, along with two ''coherence maps''—a natural transformation and a morphism that preserve monoidal multiplication and unit, respectively. Mathematicians require these coherence maps to satisfy additional properties depending on how strictly they want to preserve the monoidal structure; each of these properties gives rise to a slightly different definition of monoidal functors * The coherence maps of lax monoidal functors satisfy no additional properties; they are not necessarily invertible. * The coherence maps of strong monoidal functors are invertible. * The coherence maps of strict monoidal functors are identity maps. Although we distinguish between these different definitions here, authors may call any one of these simply monoidal functors. Defi ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  




Tensorial Strength
In category theory, a strong monad over a monoidal category (''C'', ⊗, I) is a monad (''T'', η, μ) together with a natural transformation ''t''''A,B'' : ''A'' ⊗ ''TB'' → ''T''(''A'' ⊗ ''B''), called (''tensorial'') ''strength'', such that the diagrams :, , :, and commute for every object ''A'', ''B'' and ''C'' (see Definition 3.2 in ). If the monoidal category (''C'', ⊗, I) is closed then a strong monad is the same thing as a ''C''-enriched monad. Commutative strong monads For every strong monad ''T'' on a symmetric monoidal category, a ''costrength'' natural transformation can be defined by :t'_=T(\gamma_)\circ t_\circ\gamma_ : TA\otimes B\to T(A\otimes B). A strong monad ''T'' is said to be commutative when the diagram : commutes for all objects A and B. One interesting fact about commutative strong monads is that they are "the same as" symmetric monoidal monad In category theory, a monoidal monad (T,\eta,\mu,T_,T_0) is a monad (T,\eta,\mu) on a monoidal catego ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  



MORE