Copyright | (c) Michael Szvetits 2020 |
---|---|
License | BSD3 (see the file LICENSE) |
Maintainer | typedbyte@qualified.name |
Stability | stable |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
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 + b
is propagated toc
ifa
orb
changes.c - b
is propagated toa
ifb
orc
changes.c - a
is propagated tob
ifa
orc
changes.
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 - b
is propagated toc
ifa
orb
changes.b + c
is propagated toa
ifb
orc
changes.a - c
is propagated tob
ifa
orc
changes.
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 * b
is propagated toc
ifa
orb
changes.
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 * b
is propagated toc
ifa
orb
changes.divOp c b
is propagated toa
ifb
orc
changes.divOp c a
is propagated tob
ifa
orc
changes.
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 tob
ifa
changes.
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 tob
ifa
changes.inv b
is propagated toa
ifb
changes.
negate :: Num a => Cell s a -> Cell s a -> ST s () Source #
negate a b
connects two cells using the following propagation schema:
-a
is propagated tob
ifa
changes.-b
is propagated toa
ifb
changes.