csound-expression-0.3.1: Csound combinator library

CsoundExpr.Base.SideEffect

Description

Side Effects

`SideEffect` `a` means output value `a` of opcode is not determined completely by arguments and opcode itself. `a` relies on number of appearences in body of instrument. Way out from `SideEffect` is provided by selectors. Selector gives value and updated `SideEffect`

Example a :

``` q = let (a1, a2) = fst \$ se2 \$ unirandA (1 :: Irate)
in  outs a1 a2
```

generates :

``` a1  unirand  1
a2  unirand  1
outs     a1, a2
```

Example b :

``` q = let a1 = fst \$ se1 \$ unirandA (1 :: Irate)
a2 = fst \$ se1 \$ unirandA (1 :: Irate)
in  outs a1 a2
```

generates :

``` a1  unirand  1
outs     a1, a1
```

Example c :

``` q = let v0 = unirandA (1 :: Irate)
(a1, v1) = se1 v0
(a2,  _) = se1 v1
in  outs a1 a2
```

generates :

``` a1  unirand  1
a2  unirand  1
outs     a1, a2
```

# Documentation

data SideEffect a Source

Instances

 IM CsTree a => IM CsTree (SideEffect a)

se :: IM CsTree a => Int -> SideEffect a -> ([a], SideEffect a)Source

se1 :: IM CsTree a => SideEffect a -> (a, SideEffect a)Source

se2 :: IM CsTree a => SideEffect a -> ((a, a), SideEffect a)Source

se3 :: IM CsTree a => SideEffect a -> ((a, a, a), SideEffect a)Source

se4 :: IM CsTree a => SideEffect a -> ((a, a, a, a), SideEffect a)Source