Extracting values from JSON Array of JSON Objects using Argonaut Lenses
<p>It's my first time using argonauts and only have a small knowledge of lenses (enough to get by). I've spent a while trying to figure out the problem myself but getting nowhere.</p>

<p>I'm trying to build a lens to get a JsonArray (of Strings) from some JSON. I can get as far as the Object that has the Array but not sure what to do from there.</p>

<p>The JSON looks like:</p>

<p><a href="https://i.stack.imgur.com/68v6F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/68v6F.png" alt="json example"></a></p>

<p>And my lens so far is this:</p>

<pre><code>val hashtagsView = twitterEntitiesView &gt;=&gt; jsonObjectPL("hashtags") &gt;=&gt; jArrayPL
</code></pre>

<p>I'm not sure if that <code>jArrayPL</code> is correct either. What I would like to do is just retrieve the text from the Array.</p>

<p>So to wrap up, can anyone help me in finding out how to construct a lens that looks into hashtags and then for each element of the array look into the text, finally getting a values as a <code>JsonArray</code>.</p>

<p><strong>Update:</strong></p>

<p>With some help from Travis I have the following code compiling:</p>

<pre><code>import argonaut._, Argonaut._
import monocle.std.list._, monocle.function.Each.each, monocle.function.Index.index
import scalaz._, Scalaz._

val \/-(json) = Parse.parse(rawJSON)
val lens = jObjectPrism
          .composeOptional(index("hashtags"))
          .composePrism(jArrayPrism)
          .composeTraversal(each[List[Json], Json])
          .composePrism(jObjectPrism)
          .composeOptional(index("text"))
          .composePrism(jStringPrism)

println(lens.getAll(json))
</code></pre>

<p>Unfortunately, I get a runtime error: <code>scalaz.Scalaz$.ToEitherOps(Ljava/lang/Object;)Lscalaz/syntax/EitherOps;</code> starting at the line <code>val \/-(json) = Parse.parse(rawJSON)</code></p>

<p>Thanks in advance!</p>