[Haskell-cafe] incomplete-uni-patterns

Jeff Clites jclites at mac.com
Thu Jan 26 00:29:08 UTC 2023


Does this suppress the warning?:

  let ~[addr,port] = args

and

  let ~(Just val) = mval

Jeff

> On Jan 25, 2023, at 4:05 PM, Kazu Yamamoto (山本和彦) via Haskell-Cafe <haskell-cafe at haskell.org> wrote:
> 
> Hello,
> 
> The recent GHC added incomplete-uni-patterns to the -Wall option.
> So, we have a waning with the following code:
> 
>    let [addr,port] = args
> 
> To avoid this, I changed the code to:
> 
>    let addr = head args
>        port = head $ tail args
> 
> In my opinion, this seems Lisp rather than Haskell.
> 
> Also, I need to avoid:
> 
>    let Just val = mval
> 
> Rahter, I use:
> 
>    let val = fromJust mval
> 
> This is annoying to me.
> 
> How do you get along with incomplete-uni-patterns?
> I would like to know the best current practice.
> 
> --Kazu
> 
> 
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.



More information about the Haskell-Cafe mailing list