Task

Calculate the value of   e.



(e   is also known as   Euler's number   and   Napier's constant.)



See details: Calculating the value of e

------ APPROXIMATION OF E OBTAINED AFTER N ITERATIONS ----
 
eApprox :: Int -> Double
eApprox n =
  (sum . take n) $ (1 /) <$> scanl (*) 1 [1 ..]
 
--------------------------- TEST -------------------------
main :: IO ()
main = print $ eApprox 20