Last active
December 10, 2015 18:08
-
-
Save haiiro-shimeji/4471941 to your computer and use it in GitHub Desktop.
時系列データ型
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Data ( | |
TimeSeries(..) | |
) where | |
data TimeSeries a = TimeSeries { | |
delta :: a | |
, dataArray :: [a] | |
} deriving (Show) | |
computeDerivative :: (Floating a) => TimeSeries a -> TimeSeries a | |
computeDerivative s = | |
let make' [] = [] | |
make' (d0:[]) = [] | |
make' (d0:d1:da) = ((d1 - d0)/(delta s)) : make' (d1:da) | |
in TimeSeries (delta s) $ make' (dataArray s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment