<div><div class="gmail_quote">On 14 April 2011 00:52, <span dir="ltr"><<a href="mailto:blackcat@pro-ns.net">blackcat@pro-ns.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Pattern matching works in ghci:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
let x = Just (Left (Blah [stuff]))<br>
let (Just (Left (Blah y)) = x<br>
</blockquote></blockquote>
<br></div>
Thanks! That's exactly what I'm looking for.</blockquote><div><br></div><div>FWIW there is also Data.Either which has the either function.</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
<br></div><div><div>λ> :t either</div><div>either :: (a -> c) -> (b -> c) -> Either a b -> c</div><div><br></div><div>Quite useful sometimes.</div></div></div></div>