<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr">That was my thinking with using an explicit lazy pattern match indication:</div><div dir="ltr"><br></div><div dir="ltr">    let ~(Just a) = …</div><div dir="ltr"><br></div><div dir="ltr">It seems to me that this shouldn’t warn (though apparently it does), since it’s overly opting in to a non-exhaustive match.</div><div dir="ltr"><br></div><div dir="ltr">Jeff</div><div dir="ltr"><br><blockquote type="cite">On Jan 25, 2023, at 9:08 PM, David Feuer <david.feuer@gmail.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="auto">It seems to me that instead of working around this, we should add a pragma to suppress the warning at the pattern site. Maybe something like<div dir="auto"><br></div><div dir="auto">let</div><div dir="auto">  {-# PARTIAL_MATCH #-}</div><div dir="auto">  Just a = blah blah</div><div dir="auto"><br></div><div dir="auto">That way GHC can see that you noticed the partial match and that you're okay with it.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 25, 2023, 7:06 PM Kazu Yamamoto (山本和彦) via Haskell-Cafe <<a href="mailto:haskell-cafe@haskell.org">haskell-cafe@haskell.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
The recent GHC added incomplete-uni-patterns to the -Wall option.<br>
So, we have a waning with the following code:<br>
<br>
    let [addr,port] = args<br>
<br>
To avoid this, I changed the code to:<br>
<br>
    let addr = head args<br>
        port = head $ tail args<br>
<br>
In my opinion, this seems Lisp rather than Haskell.<br>
<br>
Also, I need to avoid:<br>
<br>
    let Just val = mval<br>
<br>
Rahter, I use:<br>
<br>
    let val = fromJust mval<br>
<br>
This is annoying to me.<br>
<br>
How do you get along with incomplete-uni-patterns?<br>
I would like to know the best current practice.<br>
<br>
--Kazu<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>
<span>_______________________________________________</span><br><span>Haskell-Cafe mailing list</span><br><span>To (un)subscribe, modify options or view archives go to:</span><br><span>http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</span><br><span>Only members subscribed via the mailman list are allowed to post.</span></div></blockquote></body></html>