Commit 4acc8ea4 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺
Browse files

Tweak Haddock markup in Control.Applicative



This (arguably) improves rendering with Haddock 2.14
Signed-off-by: Herbert Valerio Riedel's avatarHerbert Valerio Riedel <hvr@gnu.org>
parent c60da54c
......@@ -27,9 +27,9 @@
-- it admits more sharing than the monadic interface. The names here are
-- mostly based on parsing work by Doaitse Swierstra.
--
-- For more details, see /Applicative Programming with Effects/,
-- by Conor McBride and Ross Paterson, online at
-- <http://www.soi.city.ac.uk/~ross/papers/Applicative.html>.
-- For more details, see
-- <http://www.soi.city.ac.uk/~ross/papers/Applicative.html Applicative Programming with Effects>,
-- by Conor McBride and Ross Paterson.
module Control.Applicative (
-- * Applicative functors
......@@ -73,34 +73,39 @@ infixl 4 <*>, <*, *>, <**>
-- functions satisfying the following laws:
--
-- [/identity/]
--
-- @'pure' 'id' '<*>' v = v@
--
-- [/composition/]
--
-- @'pure' (.) '<*>' u '<*>' v '<*>' w = u '<*>' (v '<*>' w)@
--
-- [/homomorphism/]
--
-- @'pure' f '<*>' 'pure' x = 'pure' (f x)@
--
-- [/interchange/]
--
-- @u '<*>' 'pure' y = 'pure' ('$' y) '<*>' u@
--
-- The other methods have the following default definitions, which may
-- be overridden with equivalent specialized implementations:
--
-- @
-- u '*>' v = 'pure' ('const' 'id') '<*>' u '<*>' v
-- u '<*' v = 'pure' 'const' '<*>' u '<*>' v
-- @
-- * @u '*>' v = 'pure' ('const' 'id') '<*>' u '<*>' v@
--
-- * @u '<*' v = 'pure' 'const' '<*>' u '<*>' v@
--
-- As a consequence of these laws, the 'Functor' instance for @f@ will satisfy
--
-- @
-- 'fmap' f x = 'pure' f '<*>' x
-- @
-- * @'fmap' f x = 'pure' f '<*>' x@
--
-- If @f@ is also a 'Monad', it should satisfy
--
-- * @'pure' = 'return'@
--
-- * @('<*>') = 'ap'@
--
-- If @f@ is also a 'Monad', it should satisfy @'pure' = 'return'@ and
-- @('<*>') = 'ap'@ (which implies that 'pure' and '<*>' satisfy the
-- applicative functor laws).
-- (which implies that 'pure' and '<*>' satisfy the applicative functor laws).
class Functor f => Applicative f where
-- | Lift a value.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment