+ -package:base

Add two vectors, or add a vector to a point.
add and subtract elements
Infix shorthand for plus.
Addition of type-level naturals.
Add 2 Word128
Add 2 Word256
Adds two Quantitys.
Adds two possibly scaled SQuantitys, preserving any scale factor. Use in conjunction with changeRepRound to combine quantities with differing scale factors.
TypeInt addition.
The sum of two type-level numbers
Differentiable logging sum function.

Examples of usage

>>> import Control.Arrow (runKleisli)

>>> import Control.Monad.Logger (runStdoutLoggingT)

>>> import InfBackprop (call)
>>> runStdoutLoggingT $ runKleisli (call (+)) (2, 2)
[Info] Calculating sum of 2 and 2 => 4
4
Summation differentiable binary operation.

Examples of usage

>>> import Prelude (Float)

>>> import InfBackprop (call, derivative)
>>> call (+) (2, 3) :: Float
5.0
>>> import Debug.SimpleExpr.Expr (variable)

>>> x = variable "x"

>>> y = variable "y"

>>> derivative (+) (x, y)
(1,1)
Modify the target(s) of a Lens', Iso, Setter or Traversal by adding a value. Example:
fresh :: MonadState Int m => m Int
fresh = do
id += 1
use id
>>> execState (do _1 += c; _2 += d) (a,b)
(a + c,b + d)
>>> execState (do _1.at 1.non 0 += 10) (Map.fromList [(2,100)],"hello")
(fromList [(1,10),(2,100)],"hello")
(+=) :: (MonadState s m, Num a) => Setter' s a    -> a -> m ()
(+=) :: (MonadState s m, Num a) => Iso' s a       -> a -> m ()
(+=) :: (MonadState s m, Num a) => Lens' s a      -> a -> m ()
(+=) :: (MonadState s m, Num a) => Traversal' s a -> a -> m ()
Increment the target(s) of a numerically valued Lens, Setter or Traversal.
>>> (a,b) & _1 +~ c
(a + c,b)
>>> (a,b) & both +~ c
(a + c,b + c)
>>> (1,2) & _2 +~ 1
(1,3)
>>> [(a,b),(c,d)] & traverse.both +~ e
[(a + e,b + e),(c + e,d + e)]
(+~) :: Num a => Setter' s a    -> a -> s -> s
(+~) :: Num a => Iso' s a       -> a -> s -> s
(+~) :: Num a => Lens' s a      -> a -> s -> s
(+~) :: Num a => Traversal' s a -> a -> s -> s
Append two lists, i.e.,
[x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]
[x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]
If the first list is not finite, the result is the first list. WARNING: This function takes linear time in the number of elements of the first list.