- ** Streaming Cores?

-- A ~Frame~ is an in-memory representation of your data. The ~Frames~
-- library stores each column as compactly as it knows how, and lets
-- you index your data as a structure of arrays (where each field of
-- the structure is an array corresponding to a column of your data),
-- or as an array of structures, also known as a ~Frame~. These latter
-- structures correspond to rows of your data. Alternatively, rows of
-- data may be handled in a streaming fashion so that you are not
-- limited to available RAM. In the streaming paradigm, you process
-- each row individually as a single record.

-- A ~Frame~ provides ~O(1)~ indexing, as well as any other operations
-- you are familiar with based on the ~Foldable~ class. If a data set is
-- small, keeping it in RAM is usually the fastest way to perform
-- multiple analyses on that data that you can't fuse into a single
-- traversal.

-- Alternatively, a ~Producer~ of rows is a great way to whittle down a
-- large data set before moving on to whatever you want to do next.

-- The upshot is that you can work with your data as a collection of
-- rows with either a densely packed in-memory reporesentation -- a
-- ~Frame~ -- or a stream of rows provided by a ~Producer~. The choice
-- depends on if you want to perform multiple queries against your
-- data, and, if so, whether you have enough RAM to hold the data. If
-- the answer to both of those questions is,
-- @@html:<i>@@"Yes!"@@html:</i>@@, consider using a ~Frame~ as in the
-- ~loadMovies~ example. If the answer to either question is,
-- @@html:<i>@@"Nope!"@@html:</i>@@, you will be better off with a
-- ~Producer~, as in the ~movieStream~ example.

-- ** Sanity Check

-- We can compute some easy statistics to see how things look.

-- #+BEGIN_EXAMPLE
-- λ> ms <- loadMovies
-- λ> L.fold L.minimum (view age <$> ms)
-- Just 7
-- #+END_EXAMPLE

-- When there are multiple properties we would like to compute, we can
-- fuse multiple traversals into one pass using something like the [[http://hackage.haskell.org/package/foldl][foldl]]
-- package,

minMax :: Ord a => L.Fold a (Maybe a, Maybe a)
minMax = (,) <$> L.minimum <*> L.maximum

-
minMax :: Ord a => L.Fold a (Maybe a, Maybe a)
minMax = (,) <$> L.minimum <*> L.maximum
minMax = (,) <$> L.minimum <*> L.maximum