<div dir="ltr"><div>If the desired function doesn't inspect the input then why not just use const <<thing you want>> ?<br><br></div>As to the lenses part: If you use a prism and it doesn't match, then it's a noop.<br></div><br><div class="gmail_quote"><div dir="ltr">On Tue, 20 Dec 2016 at 09:38 Jan von Löwenstein <<a href="mailto:jan.loewenstein@gmail.com">jan.loewenstein@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Hi,<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I want to have code that produces the following result no matter if input A or B was given:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Result:</div><div class="gmail_msg">{</div><div class="gmail_msg"> "outer" : {</div><div class="gmail_msg"> "inner" : "new-value"</div><div class="gmail_msg"> }</div><div class="gmail_msg">}</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">A: </div><div class="gmail_msg"><div class="gmail_msg">{</div><div class="gmail_msg"> "outer" : {</div><div class="gmail_msg"> "inner" : "old-value"</div><div class="gmail_msg"> }</div><div class="gmail_msg">}</div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">B:</div><div class="gmail_msg"><div class="gmail_msg">{}</div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">`json & key "outer"._Object.key "inner" .~ "new-value"` didn't work.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Is what I want even possible with lenses?</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Best</div><div class="gmail_msg">Jan</div></div>
_______________________________________________<br class="gmail_msg">
Haskell-Cafe mailing list<br class="gmail_msg">
To (un)subscribe, modify options or view archives go to:<br class="gmail_msg">
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" class="gmail_msg" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br class="gmail_msg">
Only members subscribed via the mailman list are allowed to post.</blockquote></div>