Haskell Programming Write a function mean :: Fractional a => [a] -> a, which determines the mean of a list. To do this
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Haskell Programming Write a function mean :: Fractional a => [a] -> a, which determines the mean of a list. To do this
Haskell ProgrammingWrite a function mean :: Fractional a => [a] -> a, which determines the mean of a list. To do this, first create a new list with map, which divides the elements of the input list by the length of the input list. Use the length funtion from haskell.Then use foldl to add the elements of the new list. you needno other higher-level functions for this except foldl and map.