integration :: (Double -> Double) -> Double -> Double -> Double
integration f a b = 
    let t = (b - a) / 1000
    in let helper step acc | step == 1000 = acc
                        | otherwise = let this_result = t * (f (a + step * t) + f (a + (step + 1) * t)) / 2
                        in helper (step + 1) (acc + this_result)
    in helper 0 0.0
integration :: (Double -> Double) -> Double -> Double -> Double
integration f a b = 
    let t = (b - a) / 1000
    in let helper step acc | step == 1000 = acc
                        | otherwise = let this_result = t * (f (a + step * t) + f (a + (step + 1) * t)) / 2
                        in helper (step + 1) (acc + this_result)
    in helper 0 0.0
integration f a b = 
    let t = (b - a) / 1000
    in let helper step acc | step == 1000 = acc
                        | otherwise = let this_result = t * (f (a + step * t) + f (a + (step + 1) * t)) / 2
                        in helper (step + 1) (acc + this_result)
    in helper 0 0.0