IN_EXAMPLE
-- λ> mapM_ print . take 6 . F.toList $ fmap miniUser ms
-- {occupation :-> "technician", gender :-> "M", age :-> 24}
-- {occupation :-> "other", gender :-> "F", age :-> 53}
-- {occupation :-> "writer", gender :-> "M", age :-> 23}
-- {occupation :-> "technician", gender :-> "M", age :-> 24}
-- {occupation :-> "other", gender :-> "F", age :-> 33}
-- {occupation :-> "executive", gender :-> "M", age :-> 42}
-- #+END_EXAMPLE

-- If you'd rather not define a function like ~miniUser~, you can fix
-- the types in-line by using the ~select~ function.

-- #+BEGIN_EXAMPLE
-- λ> :set -XDataKinds
-- λ> select (Proxy::Proxy '[Occupation,Gender,Age]) $ frameRow ms 0
-- {occupation :-> "technician", gender :-> "M", age :-> 24}
-- #+END_EXAMPLE

-- If you are frequently using this style of projection, you can also
-- take advantage of another bit of Template Haskell shorthand for
-- creating those ~Proxy~ values.

-- #+BEGIN_EXAMPLE
-- λ> :set -XDataKinds -XQuasiQuotes
-- λ> select [pr|Occupation,Gender,Age|] $ frameRow ms 0
-- {occupation :-> "technician", gender :-> "M", age :-> 24}
-- #+END_EXAMPLE

-- ** Query / Conditional Subset

-- Filtering our frame is rather nicely done using the
-- [[http://hackage.haskell.org/package/pipes][pipes]] package. Here
-- we pick out the users whose occupation is "writer".

writers :: (Occupation ∈ rs, Monad m) => Pipe (Record rs) (Record rs) m r
writers = P.filter ((== "writer") . view occupation)

-- #+BEGIN_EX
writers :: (Occupation ∈ rs, Monad m) => Pipe (Record rs) (Record rs) m r
writers = P.filter ((== "writer") . view occupation)
writers = P.filter ((== "writer") . view occupation)