Advice on Library Interface

Ketil Z. Malde ketil@ii.uib.no
08 May 2003 08:19:31 +0200


Matthew Donadio <m.p.donadio@ieee.org> writes:

> One part of the DSP library that I am working on is a module for
> generating sequences of Gaussian random variables.  Since this may be of
> use to people outside the DSP community, I wanted to get some
> suggestions on the interface.

Any reason not to mimic the Random interface?  I.e. provide both
     randomN :: StdGen -> Double
and  randomNs :: StdGen -> [Double]

BTW, can it be made more general, and parametrise the distribution
function? 

> 2.  Should the functions accept mean and/or variance parameters, or
> should they generate unit normals?  For those who forget

Contrary to (all?) others, I think the *sigma+mu pattern is so
ingrained into everybody wanting this, that the standard normal
approach is sufficient.

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants