我有以下功能:
-- | Exponential moving average.
ema :: (Fractional a)
=> a -- ^ Alpha
-> [a] -- ^ Input data
-> [a] -- ^ Output
ema alpha xs = scanl1 (\a b -> a+(alpha*(b-a))) xs
Haddock 采用上述内容并生成以下 HTML:
ema
:: Fractional a
=> a Input data
-> [a] Output
-> [a]
Exponential moving average.
“阿尔法”怎么了?