[Haskell-cafe] incomplete-uni-patterns

Kazu Yamamoto (=?iso-2022-jp?B?GyRCOzNLXE9CSScbKEI=?=) kazu at iij.ad.jp
Thu Jan 26 00:05:40 UTC 2023


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




More information about the Haskell-Cafe mailing list