If you want to add some functions or improve the package, start by posting an issue for discussion. All code needs tests and documentation. Look at other sequence and list packages to see how they solve a similar problem. Explain the use case.
- Look at other docs and try to make it fit in
- Consider a code sample
- For each new function, add a collection of tests
- Do one stress test to ensure no stack overflows, especially with recursion
- Think about how the behavior changes with dynamic/non-persistent sequences, such as where each item is generated on the fly like Js.Math.random(). For example,
allPairschooses to cache the values before generating the pairs. - Is there internal mutable state? How will that break things?
- Ensure any supplied functions are only called the minimum number of times; use the
deathsequence to ensure your function is as lazy as possible.
- Try to code each function from scratch, rather than having a lot of abstraction.
- Avoid labeled arguments unless really confusing
- Throw
InvalidArgumentexception if the parameters are clearly being misused. - Use
xx,yy,zzfor sequences - Use
x,y,zfor items in those sequences - Use
xxxfor a nested sequence - Use
inxfor index variables