| Copyright | (c) Michael Szvetits 2020 |
|---|---|
| License | BSD3 (see the file LICENSE) |
| Maintainer | typedbyte@qualified.name |
| Stability | stable |
| Portability | portable |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Data.Propagator.Num
Description
This module provides convenience functions to connect cells which hold numeric values.
Synopsis
- plus :: Num a => Cell s a -> Cell s a -> Cell s a -> ST s ()
- minus :: Num a => Cell s a -> Cell s a -> Cell s a -> ST s ()
- times :: Num a => Cell s a -> Cell s a -> Cell s a -> ST s ()
- timesWith :: Num a => (a -> a -> a) -> Cell s a -> Cell s a -> Cell s a -> ST s ()
- abs :: Num a => Cell s a -> Cell s a -> ST s ()
- absWith :: Num a => (a -> a) -> Cell s a -> Cell s a -> ST s ()
- negate :: Num a => Cell s a -> Cell s a -> ST s ()
- signum :: Num a => Cell s a -> Cell s a -> ST s ()
- signumWith :: Num a => (a -> a) -> Cell s a -> Cell s a -> ST s ()
Documentation
plus :: Num a => Cell s a -> Cell s a -> Cell s a -> ST s () Source #
plus a b c connects three cells using the following propagation schema:
a + bis propagated tocifaorbchanges.c - bis propagated toaifborcchanges.c - ais propagated tobifaorcchanges.
minus :: Num a => Cell s a -> Cell s a -> Cell s a -> ST s () Source #
minus a b c connects three cells using the following propagation schema:
a - bis propagated tocifaorbchanges.b + cis propagated toaifborcchanges.a - cis propagated tobifaorcchanges.
times :: Num a => Cell s a -> Cell s a -> Cell s a -> ST s () Source #
times a b c connects three cells using the following propagation schema:
a * bis propagated tocifaorbchanges.
timesWith :: Num a => (a -> a -> a) -> Cell s a -> Cell s a -> Cell s a -> ST s () Source #
timesWith divOp a b c connects three cells using the following propagation schema:
a * bis propagated tocifaorbchanges.divOp c bis propagated toaifborcchanges.divOp c ais propagated tobifaorcchanges.
abs :: Num a => Cell s a -> Cell s a -> ST s () Source #
abs a b connects two cells using the following propagation schema:
|a|is propagated tobifachanges.
absWith :: Num a => (a -> a) -> Cell s a -> Cell s a -> ST s () Source #
absWith inv a b connects two cells using the following propagation schema:
|a|is propagated tobifachanges.inv bis propagated toaifbchanges.
negate :: Num a => Cell s a -> Cell s a -> ST s () Source #
negate a b connects two cells using the following propagation schema:
-ais propagated tobifachanges.-bis propagated toaifbchanges.