@@ -153,6 +153,58 @@ Specifically,
153* Please use 4 spaces for indentation.
153* Please use 4 spaces for indentation.
154* Do not let the code go beyond 80 columns
154* Do not let the code go beyond 80 columns
156+Indent the `where` clause as follows:
165+In general, we avoid using a prime on the variable names, e.g. we use `step1`
166+instead of `step'`. Numbered indexing is better because it is easier on the
167+eyes and we can represent multiple generations of the variables without adding
168+more characters e.g. we can write `step2` instead of `step''`.
170+Use shorter variable names for shorter scopes, use longer variable names for
175+* Import symbols explicitly by names as long as possible
176+* Import qualified is there are too many symbols to be imported
178+### StreamD coding style
180+Some conventions that we follow in the StreamD code are illustrated by the
184+mapM f (Stream step1 state1) = Stream step state
188+ r <- step1 (adaptState gst) st
190+ Yield x s -> f x >>= \a -> return $ Yield a s
191+ Skip s -> return $ Skip s
195+* For the input streams use numbering for `step` and `state` e.g.
196+ step1/state1. For the ouput stream use `step` and `state`.
197+* For state argument of `step`, use `st`.
198+* For result of executing a `step` use `r` or `res`
199+* For the yielded element use `x`
200+* For the yielded state use `s`
202+In general, the rule is - the shorter the scope of a variable the shorter its
203+name can be. For example, `s` has the shortest scope in the above code, `st`
204+has a bigger scope and `state` has the biggest scope.
206+For better fusion we try to keep a single yield point in the state machine.
156### Organization
208### Organization
158Use this simple rule to organize functions in a file: `Define before first
210Use this simple rule to organize functions in a file: `Define before first