We define the State datatype and take a peek into its inner working. By manually constructing an instance, we’ll start to get a feel on how the type separates state management from our stateful computations. As State depends on a Pair type, we get to know how each portion can be extracted through the
snd Pair instance methods.
Chaining operations like
filter on an array can have performance issues as we have to iterate through the whole array for every operation.
In this lesson we explore this problem by doing some basic array transformations and measuring their performance.
We’ve got two utility function to help us with this:
arrayOfRandoms is a higher order function which helps us create a range of random numbers
timeIt will help us measure how long functions take to execute
It's important to understand this problem and why it occurs before we move on to how transducers handle it differently.