add base accumulate
impl accumulate.hs